• 개요
@angular/core

HOST_TAG_NAME

상수
안정화

A token that can be used to inject the tag name of the host node.

API

    
      const HOST_TAG_NAME: InjectionToken<string>;
    
    

사용 시 참고사항

Injecting a tag name that is known to exist

@Directive()
class MyDir {
  tagName: string = inject(HOST_TAG_NAME);
}

Optionally injecting a tag name

@Directive()
class MyDir {
  tagName: string | null = inject(HOST_TAG_NAME, {optional: true});
}
상세 내용으로 이동