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

后端 未结 9 924
长情又很酷
长情又很酷 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:44

    IMO changing the code all over just so that WebStorm / IntelliJ will not complain is not a viable solution. Since I have a separate bundling / compiling process I instead disabled IntelliJ's ops on typescript: Settings->Languages->Typescript - uncheck the options there. If that is already the case for you than you can try checking the options, applying and then unchecking again.

    You can see this is still a bit buggy. For example after I have done some class renaming using the IDE (SHIFT + F6) the errors returned. Repeating the above removed them again.

    Using IntelliJ 15.0.2

提交回复
热议问题