Typescript warnings when using interface and OpaqueToken in Angular 2 app

后端 未结 1 1540
暗喜
暗喜 2021-01-11 15:14

I have been following the documentation here and use ng-cli.

I created the following configuration file (app-config.ts):



        
1条回答
  •  醉梦人生
    2021-01-11 15:40

    As per comment on issue https://github.com/angular/angular-cli/issues/2034

    having the same issue. (Works fine despite warning) are you exporting more than one interface/class/const from the file? issue stopped for me after i exported each interface from its own dedicated file.

    meaning if i had one file with multiple exports - i got warnings in build (export 'MyInterface1' was not found in '../file')

    file.ts

    export interface MyInterface1 {}
    export interface MyInterface2 {}
    

    after refactor - no warning

    file1.ts

    export interface MyInterface1 {}
    

    file2.ts

    export interface MyInterface2 {}
    

    0 讨论(0)
提交回复
热议问题