I'm currently utilizing Typescript with AngularJS and have encountered an issue with modals when using the typed definition of jQuery library. The specific error message I am receiving is: 'error TS2339: Property 'modal' does not exist on type 'JQuery'.'
The version of jQuery library I am working with is 1.10.x / 2.0.x and the definitions can be found at https://github.com/borisyankov/DefinitelyTyped
Here is a snippet of the code:
$scope.delete = function (id) {
Photo.get({id: id}, function(result) {
$scope.photo = result;
$('#deletePhotoConfirmation').modal('show');// error line
});
};
In my setup, I am referencing jquery.d.ts
in angular.d.ts
<reference path="../jquery/jquery.d.ts" />
Additionally, my global vendor reference file contains:
<reference path='../vendor/types/angular/angular.d.ts' />
<reference path='../vendor/types/angular/angular-mocks.d.ts' />
<reference path='../vendor/types/jasmine/jasmine.d.ts' />