コントローラーに次のコードがあります。
ViewCtrl.resolve = {
/**
* Fetching a user model from the backend to make it available to this controller.
*/
user: ['$http', 'symfony2Router', function($http, symfony2Router) {
return $http.get(symfony2Router.path('getUser')).then(function(response) {
return response.data;
});
}]
};
そして、次の html テンプレート:
<span data-ng-repeat="item in user.articles">
{{ item.title }}
</span>
問題は、dom が angularjs によって変更され、ユーザーが持っている各記事ごとにスパンが設定された後にのみ、js コードを実行するにはどうすればよいかということです。