How to pass multiple parameter to @Directives (@Components) in Angular with TypeScript?

From the Documentation As with components, you can add as many directive property bindings as you need by stringing them along in the template. Add an input property to HighlightDirective called defaultColor: @Input() defaultColor: string; Markup <p [myHighlight]=”color” defaultColor=”violet”> Highlight me too! </p> Angular knows that the defaultColor binding belongs to the HighlightDirective because you … Read more

Jquery not working in angular 6 Error: ENOENT: no such file or directory, open ‘…\node_modules\jquery\dist\jquery.min.js’

Once again the angular team makes things harder for not real reason =( I had this problem and after Googling around fruitlessly I wondered if they had changed relative paths somehow as well as renaming angular-cli.json. A little further up in the file I found the line: Yeah, just change: “../node_modules/jquery/dist/jquery.js”, “../node_modules/tether/dist/js/tether.js”, “../node_modules/bootstrap/dist/js/bootstrap.js” to “./node_modules/jquery/dist/jquery.js”, … Read more

Bootstrap not working properly in Angular 6

You have to install both bootstrap and JQuery: npm install bootstrap jquery –save Then you will find these files in your node module folder: node_modules/jquery/dist/jquery.min.js node_modules/bootstrap/dist/css/bootstrap.min.css node_modules/bootstrap/dist/js/bootstrap.min.js Then you have to update your angular.json file: In the architect, build section, or even test section if you want to see Bootstrap working as well when testing … Read more

Angular 6 error show to ‘mat-form-field’ is not a known element:

Looking at your error ng:///AppRoutingModule/LoginComponent.html@11:2 I can conclude that you declared LoginComponent in AppRoutingModule but didn’t import MatFormFieldModule there. Either move LoginComponent to the declarations array of AppModule: @NgModule({ declarations: [ AppComponent, LoginComponent ], … }) export class AppModule { } or import MatFormFieldModule or some SharedModule in AppRoutingModule: @NgModule({ declarations: [ LoginComponent, … ], … Read more

How to reload or refresh only child component in Angular 8

Best way to update a child component is: ngOnChanges() ngOnChanges(): “A lifecycle hook that is called when any data-bound property of a directive changes. Define an ngOnChanges() method to handle the changes.” We use this lifecycle hook to respond to changes to our @Input() variables. Example: import { Component, Input, OnChanges } from “@angular/core”; @Component({ … Read more

Angular 6+ :ProvidedIn a non root module is causing a circular dependency

I ran into the same problem. Turns out the solution is “don’t do it”, as explained in this thread by one of the Angular guys: https://github.com/angular/angular-cli/issues/10170#issuecomment-380673276 It boils down to services being easier to tree shake when they are provided by the root module, as I gather. I’m as disappointed as you are.

Angular Service Worker SwUpdate.available not triggered

You will probably need to tell the service worker to check the server for updates, I usually use a service for this: export class UpdateService { constructor(public updates: SwUpdate) { if (updates.isEnabled) { interval(6 * 60 * 60).subscribe(() => updates.checkForUpdate() .then(() => console.log(‘checking for updates’))); } } public checkForUpdates(): void { this.updates.available.subscribe(event => this.promptUser()); } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)