<a [routerLink]="item.path">
or the same:
<a routerLink="{{item.path}}">
On 12/23/2017 11:10 PM, Silan wrote:
I'm new to Angular.
I have following HTML code. The "item.name" and disabled status were
displayed correctly, which means I had correct "menuitems" variable
passed in. The only display that not correct was when I click any
sub-menu item, the href value took item.path literally. Removing
double quotes around item.path didn't make difference.
<mat-menu#mySubMenu="matMenu">
<a mat-menu-item *ngFor="let item of menuitems" href="item.path"
[disabled]="item.disable">
{{ item.name }}
</a>
</mat-menu>
How to pass the value of item.path to href here, instead of taking
string "item.path" to href?
Thanks
Silan
--
You received this message because you are subscribed to the Google
Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Angular
and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.