简体   繁体   English

更改angular-cli中角度的上下文路径

[英]Change The context path for angular in angular-cli

When a generate The dist directory with angular cli i need put this in root directory of server for example: 当生成带有角度cli的dist目录时,我需要将其放在服务器的根目录中,例如:

Localhost:8080/ 本地主机:8080 /

For run correctly The angular 2 app 为正确运行Angle 2应用

But if i want put in other directory how for example: 但是,如果我想放在其他目录中,例如:

Localhost:8080/dist I got error in js files because The app find this in / root Rute Localhost:8080 / dist我在js文件中遇到错误,因为该应用程序在/ root Rute中找到此错误

Any ideas how change The contexto path?? 任何想法如何改变上下文路径?

Thanks 谢谢

in Angular 2 app not working on Apache HTTP Server supergirl recommend change the base ref in index.html and yes this works Angular 2应用程序中不适用于Apache HTTP Server supergirl,建议更改index.html中的基本引用,是的,这可行

 <base href="./">

Update : this problem resolve but with bug in path large produce The same error 404 in refresh page 更新:此问题已解决,但路径中的错误较大会在刷新页面中产生相同的错误404

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM