As a newcomer to angular, I have been struggling to incorporate it into my web application (VS) as I keep encountering issues with recognizing angular. Despite trying various methods, the result remains the same - angular is not being recognized.
I download angular.min.js from the angular website and link it to the JS folder on my page
Tried
, but no change...<script src="Scripts/angular.js"></script>
Attempted to use the package manager console:
PM> Install-Package angularjs
added successfully...
Here is the complete HTML code from my 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 encountered 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 initially used angular.min.js - changed it to src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.js". Issue resolved.