I have created a directive myToolbar that should dynamically create and append toolbarItems, triggered by an event. Each toolbarItem is passed different data.
Please, check out this jsfiddle:
The output is "baz baz baz" but it should be "foo bar baz".
Each toolbarItem has a isolated scope, but the toolbarData of all toolbarItems is overwritten by the last one.
What did I wrong?
I have a solution (jsfiddle link). But this can't be the way to go in angular.
I serialized the the toolbarData and wrote it to the toolbarItem markup.
Does someone know a clean solution?