Add locator to angular host component programmatically

Discussão em 'Angular' iniciado por NeoGER89, Novembro 24, 2025.

  1. NeoGER89

    NeoGER89 Guest

    Is it possible to add a locator to an angular host component via host property?

    @Component({
    selector: 'ui-header',
    templateUrl: './ui-header.component.html',
    styleUrl: './ui-header.component.scss',
    standalone: false,
    host: { "locator": "headerLocator" }, //???
    })
    export class UiHeaderComponent {
    title = input.required<string>()
    subtitle = input<string>()
    }


    desired result:

    <ui-header title="my-header" #headerLocator/>

    Continue reading...

Compartilhe esta Página