Angular 2 Routing Does Not Work When Deployed to Http Server

前端 未结 18 1918
误落风尘
误落风尘 2020-12-07 22:42

I am going to develop a simple Angular 2 application. I have created a project with routing, using Angular CLI and added several components to the app using \'ng generate co

18条回答
  •  情歌与酒
    2020-12-07 22:46

    You should try specifying the url in the build from the point the app should initialize:

    Ng build --prod --base-href="http://your.url.com/subdirectory/etc"
    

提交回复
热议问题