ciao!
avrei un problemino con angularjs e json.
in pratica prendo i dati in formato json da un web service e vorrei darli in pasto ad angularjs.
sulla pagina ho fatto così:
nel js:codice:<!DOCTYPE html> <html ng-app> <head> <meta charset="utf-8"> <meta name="format-detection" content="telephone=no"> <!--<meta name="msapplication-tap-highlight" content="no">--> <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 --> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.css"> <link rel="stylesheet" type="text/css" href="css/index.css"> <script src="http://www.parsecdn.com/js/parse-1.3.0.min.js"></script> <title></title> </head> <body> <p> <button onclick="testAdd();">TEST ADD</button> </p> <div ng-controller="ScoreCtrl"> <ul> <li ng-repeat="s in scores.results"> {{s.playerName}} </li> </ul> </div> <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js"></script> <script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="js/index.js"></script> </body> </html>
i dati mi arrivano sicuro perchè ho controllato, ma nella pagina non compare nulla.codice:function ScoreCtrl($scope) { Parse.initialize("", ""); $scope.scores = []; var GameScore = Parse.Object.extend("GameScore"); var query = new Parse.Query(GameScore); query.find({ success: function (res) { $scope.scores = res; }, error: function (err) { $scope.scores = res; } }); }
avete qualche idea?

Rispondi quotando