私はとても混乱しています。あなたが私を助けてくれることを願っています。
ここは私の工場です
productsFactory.getAllDiciplines = function(){
return $resource('/api/disciplines/');
}
配列を返します。
これは私のコントローラーです:
$scope.diciplines = ProductsFactory.getAllDiciplines().query();
これは私の見解です:
<select ng-model="diciplines" ng-options="d.dp_title for d in diciplines"></select><br>
これは機能します。ただし、選択ボックスでアイテムを選択すると。それは空になります。すべてのアイテムが消えます。これは、$resource が非同期呼び出しを使用していることと関係があることを知っています。
これを修正するにはどうすればよいですか?