0

I use 2 ng-click to try to do a toggle effect. first one bind to says a button, the other one used on body tag. I expect when I click the button my stuff shows up and when I click anywhere on the body, my stuff hide.

But angularjs seem unlike jquery. http://plnkr.co/edit/KG4b9B1gac53a8JkRBvu?p=preview What is the approach to achieve that?

noob
  • 101
  • 6

1 Answers1

0

the poblem here is, that clicking the button also triggers clicking the body. here a plunkr to show what i mean.

you could add your click event to the body after clicking the button.

nilsK
  • 4,323
  • 2
  • 26
  • 40
  • what you repeat my question? u stole my plunkr buddy > – noob Apr 16 '14 at 08:54
  • i pasted the wrong link, but edited it 2 seconds late. sorry about that. i didn't repeated your question. i told you, this wont work because of the "doubled" trigger on click. so again: "you could add your click event to the body after clicking the button" .. better, buddy? ;p – nilsK Apr 16 '14 at 09:00