Change img [src] dynamically
You need to bind like this <img src=”https://stackoverflow.com/questions/49671139/{{“assets/images/” + wonder.id + “.jpg” }}” [] is not compatible with {{ }}.
You need to bind like this <img src=”https://stackoverflow.com/questions/49671139/{{“assets/images/” + wonder.id + “.jpg” }}” [] is not compatible with {{ }}.
MatButtonToggle component doesn’t implement ControlValueAccessor therefore you can’t use ngModel on it. ngDefaultControl was introduced for other purposes. MatButtonToggle is supposed to be a part of mat-button-toggle-group. But if you want to use it as a standalone component and bind model to it here is some example of how you can do it: <mat-button-toggle [checked]=”myFlagForButtonToggle” … Read more
To remove .00 from the currency pipe you can use this pattern. See the digitsInfo section on CurrencyPipe for more information. {{ amount | currency : ‘USD’ : ‘symbol’ : ‘1.0-0′ }} If you don’t need the decimal you can use the number pipe. ${{amount | number}}
No need to unsubscribe from afterClosed() as it auto completes itself: https://github.com/angular/material2/blob/ae41a0ad69ca26c600f0f56c68dd5a1c102d4f1f/src/lib/dialog/dialog-ref.ts#L75
Actually the error doesn’t mean a module import problem, but that you’re using the mat-form-field without a valid control. The problem is here : <mat-form-field> <mat-checkbox formControlName=”active”>Active</mat-checkbox> </mat-form-field> MatChebox isn’t intended to be contained in a mat-form-field but yeah its name is not very clear … Keep just in mind that mat-form-field is the component … Read more
Looks like it’s a problem with Peer Dependencies try with npm install –legacy-peer-deps.
That is probably due to the fact that the :lang() selector is deprecated in this new version of Angular, you could try this instead: [lang=”en”] { // Your code } [lang=”fr”] { // Your code }
After asking on the official angular repository, it turns out to be a simple solution. Instead of passing the service name as a string, you’ll have pass the tokens through the component into the view into another component. Globally define the injection token I did this alongside my service itself to make it easier to … Read more
For me the main difference is that the PathLocationStrategy requires a configuration on the server side to all the paths configured in @RouteConfig to be redirected to the main HTML page of your Angular2 application. Otherwise you will have some 404 errors when trying to reload your application in the browser or try to access … Read more
Yes it can be attached to div tag, your route is probably wrong try add / in front of route. <div [routerLink]=”[‘/explore/brands’]”> go to this location </div>