2016-03-08から1日間の記事一覧

【AngularJS】コントローラーの変更がビューに反映されない時は$scope.apply();

jQueryのイベントを使ってモデルの値を変更した場合など、ビューに変更が伝わらない場合がある。 具体的には以下のような場合 HTML <div id="images"> <div ng-repeat="picture in pictures"> <div class="img"> <a target="_blank" href=""> <img src="{{picture.img_url}}"> </a> </div> </div> </div> .controller('PictureDetailController', function($scope, $http) { $(funct…