GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • Tutorials
  • Playground
  • Reference
  • code
  • Injecting host element attributes
  • HostAttributeToken

This view

  • Original page
  • New address

GeezerVison is showing angular.dev — HostAttributeToken • Angular

API

    
      class HostAttributeToken {}
    
    
@paramattributeNamestring
@returnsHostAttributeToken
@returnsstring

Usage Notes

Injecting an attribute that is known to exist

@Directive()
class MyDir {
  attr: string = inject(new HostAttributeToken('some-attr'));
}

Optionally injecting an attribute

@Directive()
class MyDir {
  attr: string | null = inject(new HostAttributeToken('some-attr'), {optional: true});
}
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.