1

TLDR; Is there a function similar to state.is() to check for a state which has a lot of child states, from one of its child states?

This is my setup:

Parent 1
    Child 1.1
    Child 1.2
    Child 1.3

Parent 2
    Child 2.1
        Child 2.1.1
        Child 2.1.2
    Child 2.2
    Child 2.3

I want to hide a certain element on all the children and grandchildren of Parent 2. Currently I am using the ugly way of checking each and every state.

2
  • Can you detail your question. What do you mean by TDLR here. Parent and Child are similar to Div in HTML? Commented Mar 30, 2015 at 11:20
  • It's a state hierarchy built using angular ui.router Commented Mar 30, 2015 at 11:33

1 Answer 1

2

Use $state.includes() do to a partial search for a state

Sign up to request clarification or add additional context in comments.

1 Comment

Eureka! This is what I ended up using! Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.