I have a model:
class WordList {
List<Word> words = [];
}
It's created via dependency injection into one of my views.
@NgController(
selector: '[list-ctrl]',
publishAs: 'ctrl'
)
class ListCtrl {
WordList wordList;
Scope scope;
ListCtrl(this.router, this.wordList, this.scope) {
scope.$watchCollection("", onChange );
}
I'd like to run some logic whenever an item is modified from that list. How do I accomplish this?
I believe the key is in the $watchCollection, but I can't figure out what to pass as a watch expression. "ctrl.wordList.words" will tell me when items are added/removed, but not changed.