This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Registering component to have an overloaded method that takes object as parameter, similar to directive registration #14579
Closed
Description
Would it be possible to create an overloaded method for registering components that takes object as parameter, in the same way as directive, filters, service etc..
Below are the three ways to register a directive and I am referring to the third option.
- directive(name: string, directiveFactory: IDirectiveFactory)
- directive(name: string, inlineAnnotatedFunction: any[])
- directive(object: Object)
With components you can not register using the third option. If that option is available for registering components, then I can register all the components in one call like show in below sample.
e.g.
var AppComponents;
(function (AppComponents) {
var firstComponent = (function () {
function firstComponent() {
return {
template:"",
controller: FirstComponentController
};
}
return firstComponent;
})();
AppComponents.firstComponent = firstComponent;
})(AppComponents || (AppComponents = {}));
(function (AppComponents) {
var secondComponent = (function () {
function secondComponent() {
return {
template:"",
controller: SecondComponentController
};
}
return secondComponent;
})();
AppComponents.secondComponent = secondComponent;
})(AppComponents || (AppComponents = {}));
angular.module("app", [])
.component(AppComponents)
Regards
Vijay