3

I am a beginner in angular, I am trying to load and use it in my web application (VS) but each time I get problems with recognizing angular and I dont know why...I tried different things but all have the same output - not recognizing angular

  1. I download angular.min.js from angular website and add link to this js folder from my page

  2. tried <script src="Scripts/angular.js"></script>no change...

  3. tried using package manager console : <PM> Install-Package angularjs added successfully...

here is a full code from my HTML page...

<html xmlns="http://www.w3.org/1999/xhtml" data-ng-app="test"> <head runat="server"> <script src="Scripts/angular.min.js"></script> <script src="Scripts/app.js"></script> <title></title> </head> <body> <form id="form1" runat="server"> <div> </div> </form> </body> </html> 

//app.js

 (function () { var app = angular.module('test',[]); }); 

*UPDATE: I get this error :

Unhandled exception at line 7, column 218 in http://localhost:4191/Scripts/angular.min.js 0x800a138f - JavaScript runtime error: Object expected 

Solution : I used angular.min.js - changes it to src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.js". problem solved.

8
  • It's not recognising how? Error on <script line? Error on first line to use angular? Error elsewhere? Commented Oct 26, 2014 at 11:49
  • oh sorry, I get this error :Unhandled exception at line 7, column 218 in localhost:4191/Scripts/angular.min.js 0x800a138f - JavaScript runtime error: Object expected Commented Oct 26, 2014 at 11:50
  • show us your app.js file please. it will be great if you will add it into your question. Commented Oct 26, 2014 at 11:51
  • KryDos - did it, thanks. Commented Oct 26, 2014 at 11:53
  • is not necessary to use (function(){}). please remove it. Commented Oct 26, 2014 at 11:57

1 Answer 1

4

According to the comments on this SO question the page needs the following mark-up

<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
Sign up to request clarification or add additional context in comments.

1 Comment

This worked for me. Using IE 10 and AngularJS v1.4.3.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.