I am currently in the early stages of learning typescript with angularjs through online video tutorials. I have encountered an issue while attempting to include the angular module in my "app.ts" file, which serves as the main file in the backend. Below is a snippet of my app.js code:
/// <reference path="Scripts/typings/jquery/jquery.d.ts" />
/// <reference path="Scripts/typings/angularjs/angular.d.ts" />
console.log("This is a TS file");
angular.module('classProjectApp', ['ngRoute'])
.config(function ($routeProvider) {
console.log("in Config()");
});
In order to address this issue, I added the angularjs file in my index.html file as shown below:
<html lang="en">
<head>
<meta charset="utf-8" />
<title>TypeScript HTML App</title>
<link rel="stylesheet" href="app.css" type="text/css" />
<script src="app.js"></script>
<script src="Scripts/angular.js"></script>
<script src="Scripts/angular-route.min.js"></script>
</head>
<body>
<h1>TypeScript HTML App</h1>
<div id="content"></div>
</body>
</html>
Unfortunately, despite these efforts, I continue to encounter the error message:
Uncaught ReferenceError: angular is not defined
This error persists, even though the identical example provided in the video tutorial functions properly.
P.S. It's worth noting that when adding references for angular in the index.html file, I had to utilize a relative path (Scripts/.../.../angular.js), while the tutorial simply referenced it using "angular.js".
Thank you for your assistance.