I'm not sure if this has been asked before, but I went through a lot of angular 2-way binding posts and frankly couldn't understand what they were talking about. So I'll just state my problem again.
Lets say I want to use a tags input plugin such as this. I define an angular directive called tags and within it, initialize tagsinput on a text input. The text element is bound to a model which is populated in the controller from a service.
I have this in Plunker here.
The problem is when the directive loads, the model is not populated yet, so the tagsinput plugin is initialized with an empty value. But I want it to be initialized with a server side value. I've come across this problem often and I've been resorting to initializing my plugins in service callbacks within controllers which I know is cardinal sin.
I'm unable to get out of thinking that eventually, at some level, the plugin initialization must be delayed until the service returns so the value is available. And am I correct if I say that even in the angular way of doing it, this is somehow achieved? But in any case, I'm not able to figure out how to get this working.