Actual behavior:
<md-nav-item ng-repeat="link in nav.navlinks" md-nav-sref="root.category({category: link.prettyUrl})" name="{{prettyUrl}}">{{link.name}}</md-nav-item>
In this case, it seems link.prettyUrl is not evaluated.
However, it works if changed from
md-nav-sref="root.category({category: link.prettyUrl})"
to
md-nav-sref="root.category({category: '{{link.prettyUrl}}'})"
Angular Versions: *
Additional Information:
This is due to how md-nav-sref works - md-nav-sref is interpolated in the template as a string variable wholesale, see here. As the directive has no knowledge of what link is, it then fails.
I think this is ok behavior, as Angular Material shouldn't get in the business of interpreting UI Router's state params from the attribute value.
My bad. I should have looked up the src. Thanks.
Most helpful comment
This is due to how
md-nav-srefworks -md-nav-srefis interpolated in the template as a string variable wholesale, see here. As the directive has no knowledge of whatlinkis, it then fails.I think this is ok behavior, as Angular Material shouldn't get in the business of interpreting UI Router's state params from the attribute value.