Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Error loading js on Angular

Hi. I'm having some difficulties when implementing angular on my app.

I'm using a MEAN app, with pugs files. I've included the js files on the layoyt.pug after the body tag.

The angular module is been read with ng-app on the body tag.

However, I get the following errors on Chrome console:

dashboard:184 GET http://localhost:3000/scripts/hello-world.js dashboard:184 GET http://localhost:3000/scripts/app.js dashboard:184 GET http://localhost:3000/scripts/app.js dashboard:184 GET http://localhost:3000/scripts/hello-world.js 404 (Not Found)

I've already tried to change the path of the files on the layout.pug file, but doesn't work at all.

Any one can help me?

1 Answer

Seth Kroger
Seth Kroger
56,407 Points

It would help if you showed your code, but the next thing you should check is if you set up the static middleware is set up correctly so it can serve the JS files.