Reputation: 630
I'm getting lots of errors on Visual Studio Typescript compiler when running my solution after adding this simple AngularJS controller
/// <reference path="../../../Scripts/typings/angularjs/angular.d.ts" />
"use strict";
class ProgressBarController {
static $inject: Array<string> = ["$rootScope", "$element"];
static measure = "px";
static startPageFactor = 1;
static endPageFactor = 1;
private rootScope; // todo define RootScope boilerplate
private element: JQuery;
constructor($rootScope, $element: JQuery) {
this.rootScope = $rootScope;
this.element = $element;
}
getWidth(): string {
var self = ProgressBarController,
masterBarWidth = parseFloat(this.element.css("width").split(self.measure)[0]),
totalPages = this.rootScope.app.pages.length - self.endPageFactor,
eachPageProgress = (masterBarWidth / totalPages),
currentPage = this.rootScope.app.currentIndex(),
progress = eachPageProgress * (currentPage - self.startPageFactor);
return progress + self.measure;
}
}
angular.module("myDirectives")
.controller("progressBarController", ProgressBarController);
I'm using AngularJS 1.4.9, DefinitelyTyped angular.d.ts for AngularJS 1.4+ and Visual Studio Community 2015 with Resharper 9.0 Update 1. The Typescript Tools of my project are on 1.7 and the compiler is aiming to ES3 for IE8 compatibility.
The errors are like more than 400 and the 95% come from jquery.d.ts. Are all different and one of them is "cannot find name bool".
I'm having problems also to use ng, IAngularStatic, IScope... so I just avoided them
Upvotes: 2
Views: 804
Reputation: 397
If you installed the d.ts package from NuGet, you likely have an old jQuery dependency installed. Update the jQuery.d.ts nuget package, and you should be golden :)
Upvotes: 2