In a previous project, I had this code working flawlessly. However, when I transferred the code to a new project, even the simplest case is failing.
This is what my controller looks like:
angular.module('myApp.controllers').
controller('SchoolController', ['$scope',
function($scope) {
$scope.school = "what's going on";
var query = new Parse.Query("School");
query.first().then(function(result){
$scope.school = "with this";
alert(result.get("name"));
});
}]);
Here is how the html is structured:
<p>school is {{school}}</p>
When the page renders, I can see "school is what's going on" as expected and I receive the alert with data from the server. However, why isn't the bound variable on the page changing to "with this"?
Any insights would be greatly appreciated.