Angularjs 无法使角同位素对我的布局起作用
我是AngularJS的新手,我正在用它建立一个照片库。我也尝试在我的布局中使用角同位素,但我无法使它工作 我已经包括同位素和角同位素JS文件:Angularjs 无法使角同位素对我的布局起作用,angularjs,angularjs-directive,jquery-isotope,Angularjs,Angularjs Directive,Jquery Isotope,我是AngularJS的新手,我正在用它建立一个照片库。我也尝试在我的布局中使用角同位素,但我无法使它工作 我已经包括同位素和角同位素JS文件: 但是没有运气。我错过了什么?我查看了上的示例,但找不到解决方案。我知道这是一个旧线程,但我在搜索其他线程时遇到了它。我想我刚刚处理了与您相同的问题,并通过添加iso.Directions作为依赖项来解决它: var app = angular.module('MyApp', [ 'iso.directives' ]); 希望能有所帮助。仅凭代码
但是没有运气。我错过了什么?我查看了上的示例,但找不到解决方案。我知道这是一个旧线程,但我在搜索其他线程时遇到了它。我想我刚刚处理了与您相同的问题,并通过添加iso.Directions作为依赖项来解决它:
var app = angular.module('MyApp', [
'iso.directives'
]);
希望能有所帮助。仅凭代码审查就很难说了。我从来没有用过角同位素,但我用过不带包装的角同位素。你看到什么错误了吗?你的元素有没有被同位素类装饰过?“一个简化的方法可以让这里的人信服来帮助你。”马尔克林没有错误,也没有同位素分类-/这是非常基本的角度,但仍然应该在角度同位素文档中。
<div isotope-container ng-cloak id="isotopeContainer" class="isotope stream ng-cloak" ng-controller="PhotosCtrl">
<article isotope-item class="photo" ng-repeat="photo in photosList">
<a no-click href="#">
<img lazyload ng-src="images/transparent.gif" data-original="{{photo.url}}" alt="{{photo.title}}">
</a>
</article>
</div>
'use strict';
angular.module('ng1stApp')
.controller('PhotosCtrl', function ($scope, $http) {
$http.get('/api/photosList').success(function(photosList) {
$scope.photosList = photosList;
});
})
.directive('lazyload', function($timeout) {
return {
restrict: 'A',
link: function (scope, element) {
$timeout(function() {
$(element).lazyload({
effect: 'fadeIn',
effectspeed: 500,
'skip_invisible': false
});
}, 0);
}
};
})
.directive('noClick', function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
angular.element(element).on('click',function(event){
event.preventDefault();
console.log('links are disabled');
});
}
};
});
var app = angular.module('MyApp', [
'iso.directives'
]);