Damkulul
Damkulul

Reputation: 1476

why my web application can't recognize angular.js

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.

Upvotes: 3

Views: 2908

Answers (1)

X-Dev
X-Dev

Reputation: 475

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

<meta http-equiv="X-UA-Compatible" content="IE=edge">

Upvotes: 4

Related Questions