混合静态HTML页面和角度6+

时间:2019-12-17 13:39:43

标签: html angular routing

当将静态html页面与6+应用程序混合使用而没有为每个页面编写空组件时的最佳实践是什么?

静态页面,例如...

1 个答案:

答案 0 :(得分:0)

ng-build with your index.html set properly with its components. (or conditional app-components)
rename and copy the rendered to (for example) /src/assests/aboutus.html
in angular.json find "assets":

 "assets": [
      "src/favicon.ico",
      "src/assets",
      "src"
    ],
browse localhost:4200/aboutus.html directly.
Always place the static contents in assets folder, thats a good practice.