首页 > TAG信息列表 > AppComponent
[Angular 14] Inject() function
Before v14, we do DI like this: @Component({ name: 'app-root', template: `<h1>Hello!</h1>` }) export class AppComponent { constructor(private http: HttpClient) { } } In V14, we can do: @Component({ name: 'a