boneskull / angular-tags

Pure AngularJS tagging widget with typeahead support courtesy of ui-bootstrap
MIT License
133 stars 32 forks source link

decipher.tags.added event emitted before model is actually bound #19

Open ot-dev opened 10 years ago

ot-dev commented 10 years ago

I tried to call a function in a handler for the added event that acts upon the entire array of items in the bound model, but the item isn't actually added when the added event is called.

This causes problems. It should be called "adding" or else it should not be emitted until after the item is added. Is this not possible due to a timing issue with angular binding?

LuizPanariello commented 9 years ago

The problem is that the event is being emitted in a link function, it should be broadcast in a controller so you can use it from outside of the directive.