This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var addressService = angular.module('reportIt.addressService', ['reportIt.config']); | |
/** | |
* Connect to the Sutherland shire council property & rating address service to build and validate street addresses | |
**/ | |
addressService.factory('AddressService',['$http', '$q', 'config', | |
function($http, $q, config){ | |
//Web service credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crms = angular.module('reportIt.crmsService', ['ngStorage', 'reportIt.config']); | |
/** | |
* Crms factory caches data from the CRMS webservice and makes it available as JSON to the app | |
*/ | |
appServices.factory('Crms',['$http','$q', '$localStorage', 'config', 'cacheTimeOut', | |
function($http, $q, $localStorage, config, cacheTimeOut){ | |
//Create a promise to return the CRMS objet from the service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Option 1 - function calls on the same line | |
nameOfMyservice.functionThatReturnsAPromise.then(()=>{ | |
}).then(otherFunction).then(()=>{ | |
}).catch(()=>{ | |
}); | |
//Options 2 - function calls drop to a new line |