I've setup navigation as follows, using ng-repeat, which works very well
<a ui-sref="{{link.Route}}" ng-click="clickLink(link)">
<span class="title"> {{link.Text}} </span><span class="selected"></span>
</a>
However, my navigation items frequently have sublinks, which means the parent link isn't really a navigation link, it's just used to expand and view the sublinks. But sometime it is a link, and has no sublinks to display.
The problem is for those particular cases, when there is no state available, I need to remove the ui-sref all together, because there shouldn't be a link at all. Having it there is throwing 'Error: Invalid state ref '''
How do I remove the ui-sref when a state isn't available?
ng-repeat
and the modellink
in full. How do you create the state hierarchy that you laterng-repeat
ing? Whatever the case may be, you can useng-if
orng-switch
to discern whether to display a link-flavor of<a>
(withui-sref
) or a parent link-flavor. – Domineer