Angular 2 bootstrap function gives error “Argument type AppComponent is not assignable to parameter type Type”

后端 未结 9 803
长情又很酷
长情又很酷 2021-02-01 13:14

Here is my first simple Hello World angular 2 app from Angular 2 quick start guide.

import {Component} from \'angular2/core\';
import {bootstrap} fr         


        
9条回答
  •  执笔经年
    2021-02-01 13:56

    This error introducing due to TypeScript compiler is not enabled in your IDE. you need to enable TypeScript compiler.

    Enable Typescript compiler in Webstorm:

    go to Webstorm menu(upper left menu) => Preferences menu => Languages & Frameworks => click on TypeScript => Enable Typescript compiler(enable checkbox) => enable Use tsconfig.json option => click Ok button and you are done.

提交回复
热议问题