1 resolve: { 2 store: function (todoStorage) { todoStorage.then(function (module) { module; 7 }); 8 } 9 }
然后就在controller的依赖项中读到了被注入的对象:
var todos = $scope.todos = store.todos;
此时,模板也被插到了页面上,等待controller的执行:
首先这里有一个$watch方法,监控着todos的变化,每次变化都会体现到这里,导致view的变化: