0

I am building a web app with Angular and have written some HTML, but the Angular isn't working. It's as if it's not being downloaded. So when I include a test angular expression in my html like {{1+2}} it is rendered exactly like that. Is there anything that I need to do besides include the following line in my HTML code?

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script> 

I'm sorry that this isn't the most interesting question, but I have been stuck without working Angular for a while, and I really can't figure out why. Thanks!

2
  • Strongly recommend that you take the Angular Phonecat tutorial found here Commented Jul 9, 2013 at 18:13
  • Thanks! I have done it actually--my problem was that I tried to name my module, like they did in the tutorial, but it wasn't being recognized by angular for some reason. Commented Jul 9, 2013 at 18:31

2 Answers 2

2

You need to define the module and the controller. Look for ng-app and ng-controller in this Plunker http://plnkr.co/edit/jcLnWlg3Kw7i6QuCjrdK?p=preview

You can also take a look at the angularjs seed https://github.com/angular/angular-seed

Sign up to request clarification or add additional context in comments.

Comments

0

Try adding the type attribute, I've seen this cause problems before.

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script> 

Also, definitely use F12 tools/firebug/etc.. to see if the script is actually loading when your document is loaded.

1 Comment

Thank you for reminding me that those tools exist :) they told me that Angular wasn't recognizing my ng-app tag, which fixed it!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.