4

Ok so here is my code of the controller:

$scope.isopen = false;

Here is my template file (its in Jade)

div(ng-click="isopen = !isopen") {{ isopen }}

div.dropdown(is-open="isopen")
    div.dropdown-toggle Click me
    ul.dropdown-menu
        li Asdf

So when I click on the div that initially says false, the drop down menu is just unaffected. Why? This is very frustrating.

The drop down menu works fine when I click on "Click me" itself, but I want to toggle it by using is-open.

Thanks in advance.

1
  • 2
    suggest you create a demo in plunker that replicates problem Commented Jun 13, 2014 at 2:46

1 Answer 1

1

You might be running into scope inheritance problem. Try putting isopen into an object in the scope and accessing that way.

$scope.store = {};
$scope.store.isopen = false;


div.dropdown(is-open="store.isopen")
    div.dropdown-toggle Click me
    ul.dropdown-menu
        li Asdf
Sign up to request clarification or add additional context in comments.

2 Comments

Can you make a live demo using Plunker? It will really help people to fix the issue. Are you changing the right variable in the div? div(ng-click="store.isopen = !store.isopen")
Never mind, had the old version of angular bootstrap. Thanks anyway.

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.