LoginSignup
1
1

More than 5 years have passed since last update.

MasonryをAngularで使う際に注意すること

Posted at

kotaziです。
- kotazi.com

Masonryのstampが正しく動かないことがあったのでメモ。


AngularプロジェクトでMasonryAngularJS Masonry Directiveを利用している。

その際にMasonryのstampが動いていなかったのでメモ。
なんで動かなかったかというとMyIncludeとngIfがよくなかった。

とりあえずサンプル

■ ng-ifバージョン(動かない)

See the Pen 【AngularJS】Masonry Directive Behavior with Stamp(ng-if) by Kohei Saeki (@kotazi) on CodePen.

■ ng-showバージョン(動く)

See the Pen 【AngularJS】Masonry Directive Behavior with Stamp(ng-show) by Kohei Saeki (@kotazi) on CodePen.

ngIfの場合がDOMが再生性されているので、stampが毎回解除されてしまう。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1