素材巴巴 > 程序开发 >

Angular5 import interface 报错:XXX is not a module

程序开发 2023-09-04 07:54:33

        在项目里定义了一个interface,device.ts。然后在component.ts中要使用这个interface,import之后,VSCode报错:‘xxx/xxx/xxx/device.ts’ is not a module。

        搞了半天还是没找到解决办法。后来终于在StackOverflow上找到了解决办法,那就是——重新npm start或者ng serve!!!

     

        重启大法果然好用啊!!!?

 

转载于:https://www.cnblogs.com/liulei-cherry/p/9777753.html


标签:

素材巴巴 Copyright © 2013-2021 http://www.sucaibaba.com/. Some Rights Reserved. 备案号:备案中。