2014-03-26 29 views
0

我想用角js和同位素。我为它创建了一些jsFiddle,下面给出了该过滤器的链接。角js和同位素

http://jsfiddle.net/shardulpendse/NTsZx/118/

我已创建角指令

app.directive('myDir', function() 
{ 
scope: { 
itemArr =""//accepting the array 
}, 
template://template where i have use ng-repeat on div. 
//When I click on a particular div that div height should be expanded. 
//If I clicked on another div then previously expanded dive height its height should back to normal and this div height should be expanded 
}); 

当我点击的单元(1)。该项目应该扩大,其他项目应该重新布局自己。但我无法这样做。任何人都可以帮助做到这一点。请

+0

任何机构可以帮我做这个东西。我挣扎了一下。任何人都可以帮助我 –

回答

0

如果$watch的项目,并呼吁同位素时,他们得到更新,它的工作原理:http://jsfiddle.net/c3mLpr77/

scope.$watch("itemArr", function(){ 
     var _parentNode = $('#container'); 
     _parentNode.isotope({ 
      layoutMode : 'fitColumns', 
      resizesContainer : false, 
      sortBy : 'fitOrder' 
     }); 
}, true); 

我还实施同位素的原生AngularJS版本起飞很多涉及具有AngularJS和jQuery问题还有一起玩:http://tristanguigue.github.io/angular-dynamic-layout/

+0

对不起,延迟回复。谢谢 –

+0

没问题,如果你认为有帮助,请接受答案。 – Tristan