現在、DataService(Parse)を呼び出すコントローラーで問題が発生しています。問題は、このコードが機能しないことです。
function MainCtrl($scope, DataService, $location)
{
$scope.actionList = function() {
// Call the service and fetch the list of signatures that match the given action ID
DataService.getActions(function (results) {
$scope.$apply(function () {
// Apply the results to the signatureList model so it will refresh the table in the view
$scope.actionList = results;
});
});
};
}
DataService行にブレークポイントを設定しましたが、ヒットしませんが、この方法でCtrlを実装すると、呼び出しが発生し、機能します!!:
function MainCtrl($scope, DataService, $location)
{
// Call the service and fetch the list of signatures that match the given action ID
DataService.getActions(function (results) {
$scope.$apply(function () {
// Apply the results to the signatureList model so it will refresh the table in the view
$scope.actionList = results;
});
});
}
なぜこれが起こっているのか、何か考えはありますか?
それとは別に、(2番目の実装で)一度は機能していますが、アクティビティのプロパティを表示したいと思います。このようにプロパティを取得しようとすると、機能しません。
<div id="wrapper"><div id="scroller">
<div ng-controller="MainCtrl">
<ul id="thelist">
<li ng-repeat="action in actionList">{{action.get('Action')}}</li>
</ul>
</div>
</div></div>
しかし、{{action}}のようにオブジェクト全体を取得しようとすると、実際にはすべてのエントリを見ることができます。