Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angular inject token

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  constructor(
    @Inject(MY_TOKEN) private myToken: string
  ) {
    console.log("Injected myToken", myToken);
  }
}
Source by country-code.ghost.io #
 
PREVIOUS NEXT
Tagged: #angular #inject #token
ADD COMMENT
Topic
Name
8+9 =