Getting Ready To Use the AngularJS Module

  1. Add the NuGet package to your solution (Install-Package AzureMobileAngularServices), or add the azuremobileangularservice.js file, available in the source code, to your project
  2. In the azuremobileangularservices.js file on line 9 add the URL to the Azure Mobile Web Services, and the Services Key to the WindowsAzure.MobileServices(...) call
  3. On you application html page include the reference for Windows Azure Mobile Services and the azuremobileangularservices.js files
  4. In the JavaScript where you define your Angular App Module add a reference to azureServicesModule
  5. In the JavaScript where you wish to use azuremobileangularservices add a dependency reference to AzureMobileServices

JavaScript Examples

app.js

var myAngularJSApp = angular.module('myAngularApp', [
'ngRoute',
'azureServicesModule',
'otherModule1',
...
]);

controllerExample1.js

myModule.controller('exampleController', ['$scope', '$location', '$routeParams', 'AzureMobileServices',
function ($scope, $location, $routeParams, AzureMobileServices) {
$scope.read = function() {
AzureMobileServices.read("myTable", null) //the second parameter could be a filter like: { name: "john" }
.then(function(myTableObjs) {
//process the objects and update your UI
});
}
});

Last edited Jul 18, 2014 at 5:10 PM by dmcwee, version 4