2017-06-10 14:53:29 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var serverUrl = window.FFServerUrl;
|
|
|
|
var crudRouteInit = [];
|
|
|
|
var pageRouteInit = [];
|
|
|
|
|
|
|
|
document.title = 'TCrud Example';
|
|
|
|
|
|
|
|
$(document.createElement('div')).attr('ng-controller', 'ApplicationController').attr('ng-include','\''+serverUrl+'/api/plugin/angular/thtml/application-top\'').appendTo($('body'));
|
|
|
|
$(document.createElement('div')).attr('ng-include','\''+serverUrl+'/api/plugin/angular/thtml/application-view\'').appendTo($('body'));
|
|
|
|
|
|
|
|
var tcrudUI = angular.module('tcrudUI', ['ngRoute','ngTouch','ngAnimate', 'ui.grid', 'ui.grid.pagination','ui.grid.cellNav', 'ui.grid.edit', 'ui.grid.resizeColumns', 'ui.grid.pinning', 'ui.grid.selection', 'ui.grid.moveColumns', 'ui.grid.exporter', 'ui.grid.importer', 'ui.grid.grouping', 'ui.grid.autoResize']).
|
|
|
|
config(['$routeProvider', '$locationProvider', '$sceDelegateProvider', function($routeProvider, $locationProvider, $sceDelegateProvider) {
|
2017-12-23 21:45:27 +00:00
|
|
|
|
|
|
|
console.log('config angular...');
|
|
|
|
console.log('config serverUrl: ', serverUrl);
|
|
|
|
|
2017-06-10 14:53:29 +00:00
|
|
|
// init routes
|
|
|
|
pageRouteInit.forEach(function(init) { init($routeProvider, $locationProvider); });
|
|
|
|
crudRouteInit.forEach(function(init) { init($routeProvider, $locationProvider); });
|
|
|
|
|
|
|
|
$sceDelegateProvider.resourceUrlWhitelist(['self',serverUrl+'/**']);
|
|
|
|
$routeProvider.otherwise({ redirectTo: '/ui' });
|
2017-12-23 21:45:27 +00:00
|
|
|
$locationProvider.html5Mode({requireBase: false});
|
|
|
|
|
|
|
|
console.log('config angular done.');
|
2017-06-10 14:53:29 +00:00
|
|
|
}]);
|
|
|
|
|
|
|
|
tcrudUI.run(['$route', function($route) {
|
|
|
|
$route.reload(); // ng-view works inside the ng-include
|
|
|
|
}]);
|