AngularJS Masonry for Dynamically changing heights

风格不统一 提交于 2019-12-04 07:41:21

Like with many non-Angular libraries, it appears the answer lies in wrapping the library in an Angular directive.

I haven't tried it out but it appears that is what this person did

You can use angular's $emit, $broadcast, and $on functionality.

Inside your masonry directive link function:

scope.$on('$resizeMasonry', ctrl.scheduleMasonryOnce('layout'));

Inside your masonryBrick directive link function or any other child element:

scope.$emit('$resizeMasonry');

Use $emit to send an event up the scope tree and $broadcast to send an event down the scope tree.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!