summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-services/manifestService.js
blob: 27e3a6ec04bfd4e163bea3b1059ac88a1526c433 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
appDS2.factory('ManifestService', function ($http, $q, $log) {
	return {
		// Gets and returns the manifest for the webapp.
		getManifest: function() {
			// cache control for IE
			var cc = "?cc=" + new Date().getTime().toString();
			return $http({
					method: 'GET',
					url: 'manifest' + cc,
					cache: false,
					responseType: 'json'})
			.then(function(response) {
				// $log.debug("ManifestService.getManifest: " + JSON.stringify(response));
				if (response.data == null || typeof response.data != 'object') 
					return $q.reject('ManifestService.getManifest: response.data null or not object');
				else 
					return response.data;
			}, function(error) {
				$log.error('ManifestService.getManifest failed: ' + error.data);
				return $q.reject(error.data);
			});
		}		
	};
});