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
|
// named methods on Angular modules, which follow the normal
|
||||||
// app.method(key, [ deps..., function ]) pattern.
|
// app.method(key, [ deps..., function ]) pattern.
|
||||||
function customRegistrar(angularFunction) {
|
function customRegistrar(angularFunction) {
|
||||||
|
var registered = {};
|
||||||
return function (extension, index) {
|
return function (extension, index) {
|
||||||
var app = this.app,
|
var app = this.app,
|
||||||
$log = this.$log,
|
$log = this.$log,
|
||||||
@ -67,6 +68,14 @@ define(
|
|||||||
", no key specified. ",
|
", no key specified. ",
|
||||||
JSON.stringify(extension)
|
JSON.stringify(extension)
|
||||||
].join(""));
|
].join(""));
|
||||||
|
} else if (registered[key]) {
|
||||||
|
$log.debug([
|
||||||
|
"Already registered ",
|
||||||
|
angularFunction,
|
||||||
|
" with key ",
|
||||||
|
key,
|
||||||
|
"; skipping."
|
||||||
|
].join(""));
|
||||||
} else {
|
} else {
|
||||||
$log.info([
|
$log.info([
|
||||||
"Registering ",
|
"Registering ",
|
||||||
@ -74,6 +83,7 @@ define(
|
|||||||
": ",
|
": ",
|
||||||
key
|
key
|
||||||
].join(""));
|
].join(""));
|
||||||
|
registered[key] = true;
|
||||||
app[angularFunction](
|
app[angularFunction](
|
||||||
key,
|
key,
|
||||||
dependencies.concat([extension])
|
dependencies.concat([extension])
|
||||||
|
Loading…
Reference in New Issue
Block a user