Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript AngularJS Basics (1.x) Improving Our Todo App Finalizing Our Application

michaelmuhanna
michaelmuhanna
5,340 Points

How do I run the angular ToDo list app on my machine (not in workspaces)?

I downloaded the project files to my machine and tried launching the "index.html" file in chrome but the angular information doesn't load. What am i doing wrong??

Thanks

2 Answers

Sean T. Unwin
Sean T. Unwin
28,690 Points

You'll have to run a server on your machine then access your page via localhost. This is because we are loading files such as JSON and templates.

If you have Nodejs or Python installed on your machine then starting a simple web server is really easy.

Once started, access the page in your browser with: Python: localhost:8000 ; Nodejs with http-server: localhost:8080. After the colon is the port number that your browser is allowed to access the server on.

Any of the following are to be typed into a terminal whose current directory is your project's directory or where your index.html is located:

# Python 2
python -m simpleHTTPServer

# Python 3
python3 -m http.server
// Using npm install the http-server package globally
npm install http-server -g

// start the server
http-server
michaelmuhanna
michaelmuhanna
5,340 Points

Thank you! This was exactly what i needed :)

I copied exact code that the teacher shared as the final one to VS Code and did exactly like you said and it did not work. Why ???

Are you seeing any errors in the browser console? I would check that first.