Skip to content
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
@vijquick

Description

@vijquick

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.

  1. directive(name: string, directiveFactory: IDirectiveFactory)
  2. directive(name: string, inlineAnnotatedFunction: any[])
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions