Justified Gallery jQuery プラグインを使用して Angular を操作しています。ng-repeat が並べ替えられた後、 updateJustify() 関数を呼び出す必要があります。今何が起こっているのかと思うと、並べ替え順序を変更すると、並べ替える前にギャラリーが更新されます。私に役立つディレクティブや回避策はありますか?
これは 'ng-repeat' の最初の実行用ではないことに注意してください。自分の関数を呼び出せるように、ng-repeat の並べ替えがいつ完了したかを検出する必要があります。
これが私のHTMLのコードです
<select ng-model="sortorder" ng-change='updateJustify()'>
<option value='' disabled selected> Filters </option>
<option value="+title">Title (A-Z)</option>
<option value="-title">Title (Z-A)</option>
<option value="+created">Created (New-Old)</option>
<option value="-created">Created (Old-New)</option>
</select>
<a href="#" data-ng-repeat='hero in heroarticles | orderBy: sortorder'">
<img data-ng-src='{{hero.imgPath}}' alt="{{hero.title}}" />
</a>
ありがとう