I wrote a demo, for learning with angular5
. The code was written smoothly, but in the end, the deployment was not smooth.
first of all, I used ng serve
to start the angular
server on the server, and then accessed 4200 remotely, but the access failed. Baidu said on the Internet that ng serve
was only a testing server and could not be used in this way. So I ng build
compiled the dist folder. I think that since it is a static resource, it should be OK to use apache2
, and then throw it under the apache2
server, remote access, or error
I have spent hundreds of years on the Internet, "how to deploy angular5", all use Nginx,. I don"t think that"s where the mistake lies. As shown in the figure, the page has already come out, and the error message tells me object (.) is not a function
generally this kind of problem should be the wrong path, but I don"t know why, because it is normal in the development environment. Why did it go wrong after compilation?
Please give me your advice. Thank you here.