angular安装部署的坑

1、打包前在app.module.ts中加入

import { LocationStrategy, HashLocationStrategy } from '@angular/common';
providers: [{ provide: LocationStrategy, useClass: HashLocationStrategy },],

2、检查所有的静态文件应该以assets/开头

3、index.html中base标签要改为


4、执行打包命令

ng build --prod --aot
 

你可能感兴趣的:(angular安装部署的坑)