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) Getting Started with Angular Your First Angular Directive

Dan Witts
Dan Witts
3,720 Points

Im having trouble getting my hello world script to run

Im running the code on sublime text for my computer. Im not to sure if my code is correct, or if I am saving my file wrong. I even have trouble running my code on the work space that team tree offers.

Can you please supply an example of the code you are experiencing issues with?

Steven Parker
Steven Parker
231,275 Points

You can share everything at once if you make a snapshot of your workspace and provide the link to it.

Thomas Nilsen
Thomas Nilsen
14,957 Points

Add your code here so we can have a look.

2 Answers

Travis Kennington
Travis Kennington
10,441 Points

This may be a long shot since there isn't any provided code, but I believe I had the same experience when I first started using angular on personal projects.

ANYONE FEEL FREE TO CORRECT ME ON THIS:

Because you mentioned Sublime Text, I'm assuming you are not running this through localhost. When the html runs across your custom directive, is makes a call to your directory to generate that content.

Browsers on their own will not make these AJAX calls and you will need some sort of web server to make these calls happen. Opening html files via browsers do not make the calls on their own.

I use a free copy of Visual Studios when writing Angular projects. It comes with IIS Express that works as a web server on your local machine.

Just do a bit of research on angular and local hosting and I'm sure you'll find what you are missing.

It's true, angular apps require a sever for many things. One easy solution for locally running an angular application is to download http-server via npm with: $ npm i -S http-server and run http-server` in the directory root.