error TS2554: Expected 2 arguments, but got 1 with @ViewChild

After migration to Angular 8 you should declare manually if it’s static or not @ViewChild(QuilldEditorComponent, {static: true}) quillEditorComponentInstance; If you have further questions ask them or for more details please read this issue https://github.com/angular/angular-cli/issues/14553 or take a look at offical documentation https://angular.io/guide/static-query-migration // query results available in ngOnInit @ViewChild(‘foo’, {static: true}) foo: ElementRef; OR // … Read more

No name was provided for external module

This is caused because you have an external dependency and you need to declare the name used so that the rollup knows what to look for when building the UMD bundle of my-core. To fix the warning declare your my-data in ng-package.json { “$schema”: “../../node_modules/ng-packagr/ng-package.schema.json”, “dest”: “../../dist/my-core”, “lib”: { “entryFile”: “src/public-api.ts”, “umdModuleIds”: { “my-data”: “my-data” … Read more

Access to XMLHttpRequest has been blocked by CORS policy

There are two ways this can be handled: Temporary Front-End solution so you can test if your API integration is working: Click on window -> type run and hit enter -> in the command window copy: chrome.exe –user-data-dir=”C://Chrome dev session” –disable-web-security This will open a new “Chrome” window where you can work easily. This is … Read more

Angular CLI HMR with Lazy-Loaded routes hot-reloads the whole thing

This angular-cli wiki page is deprecated: https://github.com/angular/angular-cli/issues/14053 Angular-HMR + lazy routes is currently not supported: https://github.com/PatrickJS/angular-hmr/issues/76 For a working and non-trivial solution, have a look to https://github.com/wags1999/angular-hmr-lazy-components

How to remove space bottom mat-form-field

You can add this in your css ::ng-deep .mat-form-field-wrapper{ margin-bottom: -1.25em; } NOTE: As you remove the space you cannot put <mat-hint>hint</mat-hint> or <mat-error>error</mat-error> properly. Error and hint get inside the form-field. Without using ::ng-deep( for Angular 8 ) Turn off encapsulation of your component inside which you change the padding. You can do this … Read more

How to set value to form control in Reactive Forms in Angular

Setting or Updating of Reactive Forms Form Control values can be done using both patchValue and setValue. However, it might be better to use patchValue in some instances. patchValue does not require all controls to be specified within the parameters in order to update/set the value of your Form Controls. On the other hand, setValue … Read more

tech