Why can't my web app recognize angular.js

I am new to angular, I am trying to download and use it in my web application (VS) but every time I have problems recognizing angular and I don’t know why ... I tried different things but all have the same output - not recognizing angular

  • I download angular.min.js from angular site and add link to this js folder from my page

  • tried it <script src="Scripts/angular.js"></script>

    without change ...

  • tried using the package manager console: < PM> Install-Package angularjs

    added successfully ...

here is the complete 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 am getting 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 - change it to src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.js", solved the problem.

+3


source to share


1 answer


As per the comments on this SO question, the page needs the following caption



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

      

+4


source







All Articles