问题描述
(我是Angular2星球上的新人(从垂死的星球上移出
Flex/Actionscript,请原谅这个天真的问题)
(I'm new on planet Angular2 (emigrated from dying planet
Flex/Actionscript, so please forgive this naive question)
在想到从Angular CLi
在我的项目上运行"ng build"命令后,我最终会在目录"dist"中运行正常的项目时犯了一个致命错误–我可以在一个目录中运行该项目.浏览器,放在服务器上?
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?
推荐答案
我是angel的新手,只是遇到了同样的问题.您可以直接从文件系统中打开并在浏览器中运行Index.html文件,但是必须从以下位置编辑Index.html中的href属性的路径:
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="/">
收件人:
<base href="./">
这篇关于angular-cli"ng build"没有产生有效的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!