mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 11:17:04 +00:00
[Framework] Obey priority order for controllers et al
Support overriding of controllers between bundles.
This commit is contained in:
parent
19500c2704
commit
733a282f3f
@ -52,6 +52,7 @@ define(
|
||||
// named methods on Angular modules, which follow the normal
|
||||
// app.method(key, [ deps..., function ]) pattern.
|
||||
function customRegistrar(angularFunction) {
|
||||
var registered = {};
|
||||
return function (extension, index) {
|
||||
var app = this.app,
|
||||
$log = this.$log,
|
||||
@ -67,6 +68,14 @@ define(
|
||||
", no key specified. ",
|
||||
JSON.stringify(extension)
|
||||
].join(""));
|
||||
} else if (registered[key]) {
|
||||
$log.debug([
|
||||
"Already registered ",
|
||||
angularFunction,
|
||||
" with key ",
|
||||
key,
|
||||
"; skipping."
|
||||
].join(""));
|
||||
} else {
|
||||
$log.info([
|
||||
"Registering ",
|
||||
@ -74,6 +83,7 @@ define(
|
||||
": ",
|
||||
key
|
||||
].join(""));
|
||||
registered[key] = true;
|
||||
app[angularFunction](
|
||||
key,
|
||||
dependencies.concat([extension])
|
||||
|
Loading…
Reference in New Issue
Block a user