How can I have an abstract parent state know which child state is active?

apdm

Using UI-router, I have an abstract parent state with 6 child states. The child states are loaded using tabs on the parent state template. Using ng-class, I want the active tab to be highlighted. I can set a $scope.active_tab variable and change it every time the user clicks a new tab, but that won't work if a child state is navigated to directly via url.

Manuel Obregozo

You could use ui-sref-active directive, which allows you to add classes to an element when the related ui-sref state is active

<ul>
  <li ui-sref-active="active" class="item">
    <!-- ... -->
  </li>
  <!-- ... -->
</ul>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I make a button have a :active state for 1 second?

From Dev

How can I set state in a child component from a parent?

From Dev

How can I change the state of a parent component from a child component?

From Dev

How can I change the state of a parent component from a child component?

From Dev

How do I manage state on a React component that can have state changed from the parent or from events upon it?

From Dev

Using Angular UI router I would like to highlight abstract parent state and link to child concrete state

From Dev

UI Router: redirect to child state when navigating to abstract parent state

From Dev

UI-Router: state params in child state when parent abstract

From Dev

Purescript Halogen: can I request the state of child component that is also a parent?

From Dev

With UI-Router how can I do an action on change of state from parent to child?

From Dev

How can I get the state of child checkbox components within a parent ListView component using React-Native?

From Dev

Can I have a child state that is the index using ui-router?

From Dev

Angular doesn't load state if I use abstract parent state

From Dev

Angular doesn't load state if I use abstract parent state

From Dev

Have parent state default to child state using ui-router

From Dev

How to check if current state in ui-router is a child of an abstract state

From Dev

How can I know the application state of an Android App to display or not a notification?

From Dev

How to know which state value changes in ngrx?

From Dev

How can I know which child has exited in C?

From Dev

Is there a way I can have an in between abstract state to avoid repeating same view template details?

From Dev

How to pass state with parent to child component

From Dev

How to get state from child to parent react

From Dev

How can I get the state of a child after it exited?

From Dev

How can I create new window with same state as parent window?

From Dev

how can I detect which combobox state changed?

From Dev

How can I kill all yarn applications which are in "ACCEPTED" state

From Dev

How can I kill all yarn applications which are in "ACCEPTED" state

From Dev

How to maintain a state in a property, which needs to be accessed from different classes in a (kind of) parent/child relationship?

From Java

Why can't I see parent state from child component event handler?

Related Related

  1. 1

    How can I make a button have a :active state for 1 second?

  2. 2

    How can I set state in a child component from a parent?

  3. 3

    How can I change the state of a parent component from a child component?

  4. 4

    How can I change the state of a parent component from a child component?

  5. 5

    How do I manage state on a React component that can have state changed from the parent or from events upon it?

  6. 6

    Using Angular UI router I would like to highlight abstract parent state and link to child concrete state

  7. 7

    UI Router: redirect to child state when navigating to abstract parent state

  8. 8

    UI-Router: state params in child state when parent abstract

  9. 9

    Purescript Halogen: can I request the state of child component that is also a parent?

  10. 10

    With UI-Router how can I do an action on change of state from parent to child?

  11. 11

    How can I get the state of child checkbox components within a parent ListView component using React-Native?

  12. 12

    Can I have a child state that is the index using ui-router?

  13. 13

    Angular doesn't load state if I use abstract parent state

  14. 14

    Angular doesn't load state if I use abstract parent state

  15. 15

    Have parent state default to child state using ui-router

  16. 16

    How to check if current state in ui-router is a child of an abstract state

  17. 17

    How can I know the application state of an Android App to display or not a notification?

  18. 18

    How to know which state value changes in ngrx?

  19. 19

    How can I know which child has exited in C?

  20. 20

    Is there a way I can have an in between abstract state to avoid repeating same view template details?

  21. 21

    How to pass state with parent to child component

  22. 22

    How to get state from child to parent react

  23. 23

    How can I get the state of a child after it exited?

  24. 24

    How can I create new window with same state as parent window?

  25. 25

    how can I detect which combobox state changed?

  26. 26

    How can I kill all yarn applications which are in "ACCEPTED" state

  27. 27

    How can I kill all yarn applications which are in "ACCEPTED" state

  28. 28

    How to maintain a state in a property, which needs to be accessed from different classes in a (kind of) parent/child relationship?

  29. 29

    Why can't I see parent state from child component event handler?

HotTag

Archive