Когда я нажимаю на свой HTML-img, ng-click не работает. Я не понимаю, почему. Эта ошибка возникает в masonryPictureView.html.
Главная страница – home.html
<ng-masonry>
<ng-picture ng-items="projectdescription.pictures"></ng-picture>
</ng-masonry>
Шаблон директивы ngPicture - masonryPictureView.html
<ul class="grille">
<li ng-repeat="item in ngItems">
<img ng-click="test()" src="{{item.img}}"/> <------ NG-CLICK
</li>
</ul>
Директива в home.html
app.directive('ngMasonry', [function () {
return {
restrict: 'E',
scope: {},
transclude: true,
templateUrl: "shared/masonry/masonryView.html",
controller: function ($scope) {
xxxxxxxxx......
},
}
}])
app.directive('ngPicture', ['$modal', '$log', function ($modal, $log) {
return {
require: "^ngMasonry",
restrict: 'E',
scope: {
ngItems: '=ngItems'
},
templateUrl: "shared/masonry/masonryPictureView.html",
link: function (scope, element, attrs, ngMasonryCtrl) {
ngMasonryCtrl.setPictures(scope.ngItems);
},
controller: function ($scope) {
$scope.test = function () < -- -- - function call in NG - CLICK {
console.log("toto");
}
}
}
}])
ngclick
и вместо этого обернуть свое изображение. - person Wayne Ellery   schedule 23.05.2015},
в концеfirst directive's controller:
не вызывает никаких проблем, верно? в-третьих, можете ли вы проверить, достигает ли он функцииsecond directive's controller:
, поместивconsole.log
чуть выше$scope.test
, наконец, нужно ли вамrestrict: EA
дляsecond directive
? - person Shehryar Abbasi   schedule 23.05.2015