プロジェクトにAngularを使用していますが、ngRepeatが機能していないようです。ここでは、コードです:ngRepeat要素を表示しない
HTMLコード:
<ion-content>
<ul class="list">
<li ng-repeat="r in res" class="item">
<h2>{{r.name}}</h2>
<p>{{r.locality}}</p
</li>
</ul>
</ion-content>
JSコード:
Backendlessは、すべての値を持つ配列を返しています。それはコンソールに正しい値を返しますが、ng-repeat部分は機能しません。私はChrome上の要素を検査し、ng-repeat部分は<!-- ngRepeat: r in res -->
に変換されています。何がうまくいかないのですか? console.log(RES)の
例:
[DataStore.model]
0: DataStore.model
agent_email: "[email protected]"
amenities: "example"
city: "bangalore"
name: "jw marriott"
// other parameters
1: DataStore.model
agent_email: "[email protected]"
amenities: "example"
city: "bangalore"
name: "fairfield marriott"
//other parameters
length: 2
質問の回答の例を追加します。 –
これは、 'ng-repeat'が' scope'変数を見つけることができないときに主に発生します。コントローラを含んでいることを確認してください。 –
あなたの$ scopeバインディングを '$ scope。$ apply()' – Gaara