Angular2 relative paths for templateUrl and styleUrls?

后端 未结 2 481
北海茫月
北海茫月 2020-12-09 14:36

While searching I found something named as moduleId to set the relative paths of template and CSS files, but I don\'t know exactly how to use moduleId

2条回答
  •  执念已碎
    2020-12-09 14:37

    Resolved my Problem by changing path (from src to dist)of importing file at the run time like this :-

    moduleId: module.id.replace("/dist/", "/src/")
    

    By doing so you can change path directory of module ID.

    thanks to @Nicolai for this awesome comment

    PS:- Posting as answer may help someone

提交回复
热议问题