Presenting my very first Angular 2 application with a simple Hello World
example, inspired by the Angular 2 quick start guide.
import {Component} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser';
@Component({
selector: 'ng2-app',
template: '<h1>My first Angular 2 App</h1>'
})
export class AppComponent { }
bootstrap(AppComponent);
Although the application functions smoothly with npm start
, my IntelliJ IDE is flagging an error at the line containing bootstrap(AppComponent)
.
The argument type AppComponent is not assignable to the parameter type Type
https://i.sstatic.net/5xWna.png
Upon examining the declaration of the bootstrap
function, it seems that AppComponent
should extend Type
.
export declare function bootstrap(appComponentType: Type, customProviders?: Array<any>): Promise<ComponentRef>;
My query is:
Is it a standard practice for Angular components to inherit from Type
?