来自file:///协议的Angular2 [英] Angular2 from file:/// protocol
问题描述
有人知道Angular2是否能够从file:///运行吗?如果是这样,请为我指出一个示例模板.
Does anyone know if Angular2 will be able to run from file:/// at all? If so, please point me to a sample template.
我已经使用angular-cli创建了一个示例angular2应用程序.我测试了样本,并获得默认的应用程序正在运行!"信息.在此之后,我使用了"ng build -prod"来创建分发输出.我还运行了"ng serve -prod"来测试生产版本.
I have created a sample angular2 app using the angular-cli. I tested the sample and got the default "app is working!" message. After this, I used "ng build -prod" to create the distribution output. I also ran "ng serve -prod" to test the production build.
我丢失了捆绑的文件(file:///C:/main.d02450dd52811831e517.bundle.js),我想这是由于迫使文件系统在工作驱动器中扎根.
I get missing bundled files (file:///C:/main.d02450dd52811831e517.bundle.js), and I guess it is due to the that forces the file system to root in the working drive.
推荐答案
保留基本href. [点字符]!
keep a base href . [A dot character]!!
我们做了同样的事情&甚至还可以将其作为cordova应用程序运行.
We did the same thing & Were even able to run it as a cordova app.
这篇关于来自file:///协议的Angular2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!