-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathapp.js
51 lines (42 loc) · 1.47 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
@toc
1. setup - whitelist, appPath, html5Mode
*/
'use strict';
angular.module('AngularUiTableView', [
'ngRoute',
'ngSanitize',
'ngTouch',
'ngAnimate',
'restangular',
//additional angular modules
'mallzee.ui-table-view'
]).
config(['$routeProvider', '$locationProvider', '$compileProvider', 'RestangularProvider', function($routeProvider, $locationProvider, $compileProvider, RestangularProvider) {
/**
setup - whitelist, appPath, html5Mode
@toc 1.
*/
$locationProvider.html5Mode(false); //can't use this with github pages / if don't have access to the server
var staticPath = '/';
//var staticPath;
//staticPath ='/angular-directives/angular-ui-table-view/'; //local
// staticPath ='/angular-ui-table-view/'; //gh-pages
var appPathRoute = '/';
var pagesPath = staticPath+'examples/';
$routeProvider.when(appPathRoute+'home', {templateUrl: 'examples/table-view/table-view.html'});
$routeProvider.otherwise({redirectTo: appPathRoute+'home'});
RestangularProvider.setBaseUrl('http://staging.api.mallzee.com');
RestangularProvider.setRestangularFields({
id: "_id"
});
// Now let's configure the response extractor for each request
RestangularProvider.setResponseExtractor(function(response) {
if (response.records) {
var newResponse = response.records;
newResponse.originalElement = angular.copy(response);
return newResponse;
}
return response;
});
}]);