KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to figure out why my $watch isn't being triggered. This is a snippet from the relevant controller: $scope.$watch('tasks', function (newValue, oldValue) { //do some stuff //only enters here once //newValue and oldValue are equal at that point }); $scope.tasks = tasksService.tasks(); $scope.addTask = function (taskCreationString) { tasksService.addTask(taskCreationString);//modifies tasks array }; On my view, tasks is clearly being updated correctly as I have its length bound like so: <span>There are {{tasks.length}} total tasks</span> What am I missing?
Tags (comma-separated)
Save Edits
Cancel