angular.js - Angular 2 writes a Hello paragraph and uses ng build and then clicks HTML but it cannot be loaded.
PHP中文网
PHP中文网 2017-05-15 17:12:51
0
1
530

As shown in the picture
1.
HTML code

2. This is the TS code

3. Enter the file generated by ng build

4. Open HTML

Cannot run all the time
HELLO can be displayed in ng server

PHP中文网
PHP中文网

认证0级讲师

reply all(1)
阿神

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template