forked from linnovate/mean
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
50 lines (40 loc) · 1.41 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
'use strict';
import 'angular/angular-csp.css';
import 'angular-ui-select/select.min.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import jQuery from 'jquery';
import 'angular';
import 'angular-ui-select/select';
import 'angular-mocks';
import 'angular-cookies';
import 'angular-resource';
import 'angular-sanitize';
import 'angular-ui-router';
import 'angular-jwt';
import 'angular-bootstrap/ui-bootstrap-tpls';
window.$ = jQuery;
angular.element(document).ready(function () {
//Fixing facebook bug with redirect
if (window.location.hash === '#_=_') window.location.hash = '#!';
//Then init the app
angular.bootstrap(document, ['mean']);
});
function processModules(modules) {
var packageModules = ['ngCookies', 'ngResource', 'ui.bootstrap', 'ui.router', 'ui.select', 'ngSanitize'], m, mn;
for (var index in modules) {
m = modules[index];
mn = 'mean.' + m.name;
angular.module(mn, m.angularDependencies || []);
packageModules.push(mn);
}
var req = require.context('./packages', true, /\/public\/(?!tests|assets|views)(.*)\.js$/);
req.keys().map(req);
req = require.context('./node_modules', true, /\/meanio-(admin|system|users|circles)\/public\/(?!tests|assets|views)(.*)\.js$/);
req.keys().map(req);
angular.module('mean', packageModules);
}
jQuery.ajax('/_getModules', {
dataType: 'json',
async: false,
success: processModules
});