简体   繁体   中英

Angular4 - Blank page for sample project

I'm trying to learn angular4 by following the Quick Start Page by angular.io . After Step3 given in this guide, I'm able to see the web page. Out of curiosity I tried running the server from project root directory instead of "src" directory. But this time I'm getting a blank page. I can see the HTML elements from browser "source code". Do I have to make anything updated to make it working?

URL which I used:

http://localhost/myapp/src/

// Editing because I misread your question initially.

Check out .angular-cli.json . It specifies the main and index files for your project. You could probably get away with changing "main" to be src/ plus whatever it is now. Note that for a single-page application, you generally won't be navigating to a sub-directory -- just the hostname / port of the server. So you're probably seeing raw code in your browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM