如图1.HTML 代码
2.这是TS 代码3.输入 ng build 生成的文件4.打开 HTML
一直不能运行在ng server里就能显示HELLO
认证0级讲师
This is because if you double-click to open index.html directly, <base href="/"> will affect the loading of all subsequent css and js.
<base href="/">
But if you add another sentence, it will cause APP_BASE_HREF exception and still cannot be accessed.
APP_BASE_HREF
The normal approach is to rely on a web service (such as IIS, Nginx, etc.) to ensure that resources are loaded normally.
This is because if you double-click to open index.html directly,
<base href="/">
will affect the loading of all subsequent css and js.But if you add another sentence, it will cause
APP_BASE_HREF
exception and still cannot be accessed.The normal approach is to rely on a web service (such as IIS, Nginx, etc.) to ensure that resources are loaded normally.