Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I'm trying to use a simple Angular function in my Laravel 5 project and I keep getting this error:

angular is not defined

I have tried to move angular.min.js to the top making it the first JS script on my index page but it still doesn't work.

This is my code: pastebin code

It only outputs {{name}} and not the actual string from the controller!

What am I doing wrong?

share|improve this question
up vote 0 down vote accepted

I have seen this issue before. In my case it was due to the incorrect relative reference i was using. I am not an expert in this matter but i would recommend you to try with different combinations and see if it helps. Also see where the js folder is placed in your website hierarchy

Ex. src="js/angular.min.js" or src="../js/angular.min.js"

share|improve this answer
    
Thank you! i changede from "/js/angular.min.js" to "js/angular.min.js" and it worked! :) – Webbie Jun 20 '15 at 0:36

You script tags are wrapped in a conditional IE tag.

<!--[if lt IE 9]>

Place your angular script tag outside of that and you'll be fine.

share|improve this answer
    
it didnt work :( I even put the script at the top of the <head> tag – Webbie Jun 20 '15 at 0:22

If you've downloaded the angular.js file from Google, you need to make sure that everyone has Read access to it, or it will not be loaded by your HTML file. By default, it seems to download with No access permissions.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.