moved modules to typescript. Tell Webpack to use global window.angular object in order to migrate components gradually into bundle
This commit is contained in:
parent
d5a74af024
commit
c55e9f2d12
15 changed files with 590 additions and 505 deletions
34
static/js/quay-pages.module.ts
Normal file
34
static/js/quay-pages.module.ts
Normal file
|
@ -0,0 +1,34 @@
|
|||
import * as angular from 'angular';
|
||||
|
||||
|
||||
export default angular
|
||||
.module('quayPages', [])
|
||||
.constant('pages', {
|
||||
'_pages': {},
|
||||
|
||||
'create': function(pageName, templateName, opt_controller, opt_flags, opt_profiles) {
|
||||
var profiles = opt_profiles || ['old-layout', 'layout'];
|
||||
for (var i = 0; i < profiles.length; ++i) {
|
||||
this._pages[profiles[i] + ':' + pageName] = {
|
||||
'name': pageName,
|
||||
'controller': opt_controller,
|
||||
'templateName': templateName,
|
||||
'flags': opt_flags || {}
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
'get': function(pageName, profiles) {
|
||||
for (var i = 0; i < profiles.length; ++i) {
|
||||
var current = profiles[i];
|
||||
var key = current.id + ':' + pageName;
|
||||
var page = this._pages[key];
|
||||
if (page) {
|
||||
return [current, page];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.name;
|
Reference in a new issue