Skip to content

ui-sref, abstract states and ui-sref-active #2954

@CSchulz

Description

@CSchulz

I am using an abstract state to define an URL hierarchy. The abstract state is used as parent of a drop-down menu and should route to some child page. Using ui-router 0.3.1.

My menu:

<li class="dropdown" ui-sref-active="active" ui-sref="administration">
    <a ui-sref="administration.user.list" class="dropdown-toggle" data-hover="dropdown">administration</a>
    <ul class="dropdown-menu">
        <li ui-sref-active="active"><a ui-sref="administration.user.list">users</a></li>
        <li ui-sref-active="active"><a ui-sref="administration.group.list">groups</a></li>
    </ul>
</li>

When I click on the administration entry, it shows me Error: Cannot transition to abstract state 'administration' and change to administration.user.list.

I can fix it with removing ui-sref="administration" for the first li, but then there is no hightlighting for the root entry anymore if I select groups.

image

Is there any way to use abstract states to highlight nav entries?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions