AngularTS
    Preparing search index...

    Interface Component<TController, TScope, TElement>

    Defines a component's configuration object (a simplified directive definition object).

    interface Component<
        TController extends Controller = Controller,
        TScope extends ng.Scope = ng.Scope,
        TElement extends HTMLElement = HTMLElement,
    > {
        bindings?: Record<string, string>;
        controller?: string | Injectable<ControllerConstructor>;
        controllerAs?: string;
        replace?: boolean;
        require?: Record<string, string>;
        template?: string | Injectable<(...args: never[]) => string>;
        templateUrl?: string | Injectable<(...args: never[]) => string>;
        transclude?: boolean | Record<string, string>;
        view?: (
            context: ProgrammaticViewContext<
                TController,
                undefined,
                TScope,
                TElement,
            >,
        ) => ProgrammaticViewChild;
    }

    Type Parameters

    • TController extends Controller = Controller
    • TScope extends ng.Scope = ng.Scope
    • TElement extends HTMLElement = HTMLElement
    Index

    Properties

    bindings?: Record<string, string>

    Define DOM attribute binding to component properties. Component properties are always bound to the component controller and not to the scope.

    controller?: string | Injectable<ControllerConstructor>
    controllerAs?: string

    An identifier name for a reference to the controller. If present, the controller will be published to its scope under the specified name. If not present, this will default to '$ctrl'.

    replace?: boolean

    Replaces the generated component host element with the component template.

    require?: Record<string, string>

    Requires the controllers of other directives and binds them to this component's controller. The object keys specify the property names under which the required controllers (object values) will be bound. Note that the required controllers will not be available during the instantiation of the controller, but they are guaranteed to be available just before the onInit method is executed!

    template?: string | Injectable<(...args: never[]) => string>

    html template as a string or a function that returns an html template as a string which should be used as the contents of this component. Empty string by default. If template is a function, then it is injected with the following locals: $element - Current element Use the array form to define dependencies.

    templateUrl?: string | Injectable<(...args: never[]) => string>

    Path or function that returns a path to an html template that should be used as the contents of this component. If templateUrl is a function, then it is injected with the following locals: $element - Current element Use the array form to define dependencies.

    transclude?: boolean | Record<string, string>

    Whether transclusion is enabled. Disabled by default.

    view?: (
        context: ProgrammaticViewContext<
            TController,
            undefined,
            TScope,
            TElement,
        >,
    ) => ProgrammaticViewChild

    Programmatic real-DOM view factory. It runs during linking after controller bindings and onInit, and is mutually exclusive with template, templateUrl, and replace.