Reference 1: https://gist.github.com/JohannesHoppe/e8d07d63fc345a5fdfdf4fc4989ef2e4 import { FormGroup, ValidationErrors } from ‘@angular/forms’; export function getFormValidationErrors(form: FormGroup) { const result = []; Object.keys(form.controls).forEach(key => { const controlErrors: ValidationErrors = form.get(key).errors; if (controlErrors) { Object.keys(controlErrors).forEach(keyError => { result.push({ ‘control ‘: key, ‘error’: keyError, ‘value’: controlErrors[keyError] }); }); } }); return result; } Reference 2: public ngOnInit() { this.form.valueChanges.subscribe(data => this.onValueChanged(data));…
Year: 2018
Yii2 errors – Failed to clone the git and “extra.asset-installer-paths” option is deprecated`
Error 1. The “extra.asset-installer-paths” option is deprecated, use the “config.fxp-asset.installer-paths” option Update composer.json by removing asset-installer-paths and add fxp-assets { … “extra”: { “yii\\composer\\Installer::postCreateProject”: { “setPermission”: [ { “runtime”: “0777”, “web/assets”: “0777”, “yii”: “0755” } ], “generateCookieValidationKey”: [ “config/web.php” ] } }, “fxp-asset”: { “installer-paths”: { “npm-asset-library”: “vendor/npm”, “bower-asset-library”: “vendor/bower” } } … } Error…
Javascript project devtools
Javascript project development tools Babel: https://babeljs.io/docs/en/ Javascript compiler – Transform syntax, Polyfill features and so on $ babel -o dist/package.js dist/package.js Standard: https://standardjs.com/ Javascript style guide, linter and formatter $ standard src/*.js Rollup: https://github.com/rollup/rollup Javascript module bundler $ rollup src/main.js –format iife –name “SamplePackage” –file dist/package.js UglifyJS: https://www.npmjs.com/package/uglify-js Javascript parser, minifier, compressor and beautifier $ uglifyjs dist/package.js -c -m…
Backup/Restore pacman & yaourt packages list
Arch linux Backup pacman package list pacman -Qqet | grep -v “$(pacman -Qqg base)” | grep -v “$(pacman -Qqm)” > pacman-packages.txt Restore pacman package pacman -S –needed $(cat pacman-packages.txt) Backup yaourt package list pacman -Qm > yaourt-packages.txt Backup yaourt package yaourt -S –needed –noconfirm $(cat yaourt-packages.txt)
Local workspace file (‘angular.json’) could not be found.
After upgrading Angular application using ncu -a, got an error message Local workspace file (‘angular.json’) could not be found.</code. $ ncu -a $ npm run build Local workspace file (‘angular.json’) could not be found. Error: Local workspace file (‘angular.json’) could not be found. at WorkspaceLoader._getProjectWorkspaceFilePath (/srv/project/node_modules/@angular/cli/models/workspace-loader.js:44:19) at WorkspaceLoader.loadWorkspace (/srv/project/node_modules/@angular/cli/models/workspace-loader.js:31:21) at BuildCommand._loadWorkspaceAndArchitect (/srv/project/node_modules/@angular/cli/models/architect-command.js:189:32) at BuildCommand.<anonymous> (/srv/project/node_modules/@angular/cli/models/architect-command.js:55:25)…
Error on installing `networkmanager-l2tp 1.2.10-3` in Arch Linux
References: https://gist.github.com/pastleo/aa3a9524664864c505d637b771d079c9 https://askubuntu.com/questions/981165/l2tp-ipsec-failing-to-connect-kubuntu-17-10 When run the command to install the package `networkmanager-l2tp 1.2.10-3`, an error occurs like below: $ yaourt -S networkmanager-l2tp … ==> Validating source files with md5sums… network-manager-l2tp-1.2.10.tar.gz … Passed network-manager-l2tp-1.2.10.tar.gz.asc … Skipped ==> Verifying source file signatures with gpg… network-manager-l2tp-1.2.10.tar.gz … FAILED (unknown public key 49A7787EF8D3C039) ==> ERROR: One or more…