Angular2 module has no exported member

前端 未结 10 1211
梦谈多话
梦谈多话 2020-12-29 01:09

For a website with authentication in Angular2, I want to use a component of the authentication submodule in the main app component. However, I keep getting the following err

相关标签:
10条回答
  • 2020-12-29 02:04

    Working with atom (1.21.1 ia32)... i got the same error, even though i added a reference to my pipe in the app.module.ts and in the declarations within app.module.ts

    solution was to restart my node instance... stopping the website and then doing ng serve again... going to localhost:4200 worked like a charm after this restart

    0 讨论(0)
  • 2020-12-29 02:05

    I got similar issue. The mistake i made was I did not add service in the providers array in app.module.ts. Hope this helps, Thank You.

    0 讨论(0)
  • 2020-12-29 02:06

    Also some of common cases :

    maybe you export class with "default" prefix like so

    export default class Module {}
    

    just remove it

    export class Module {}
    

    this is solve the issue for me

    0 讨论(0)
  • 2020-12-29 02:06

    For my case, I restarted the server and it worked.

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