Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
268 views
in Technique[技术] by (71.8m points)

angular-cli "ng build" doesn't produce a working project?

(I'm new on planet Angular2 (emigrated from dying planet
Flex/Actionscript, so please forgive this naive question)

Have I made a fatal error in thinking that after running the "ng build" command on my project from Angular CLi, I would end up with a functioning project in the directory "dist" – which I could just run in a browser, put up on a server?

I end up with a folder full of correctly named stuff, etc. Is there a step I am missing here?

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I'm new to angular, and just ran into the same issue. You can open up and run the Index.html file in the browser directly from the file system, but you have to edit the path of the base href attribute in Index.html from:

<base href="/">

to:

<base href="./">

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...