Dynamicly add Buttons to Navbar from within a directive


#1

Hi

I have a directive . To interact with the directive, I would like that the directive, adds a button to the navbar.
But because there are 2 navbars “cached” & "active or entering" It doesn’t work as expected.

Also navigate 2-3 times somewhere else and see what happens.
Any ideas?

Of course a Codepen for you: http://codepen.io/anon/pen/remrYw?editors=1010
And another try with a factory http://codepen.io/anon/pen/yOXJge?editors=1010