I have a very simple file:
/// <reference path="../typings/browser/ambient/jquery/jquery" /> import {Component} from "angular2/core"; @Component({}) export class AppComponent{ constructor(){ $.isEmptyObject({}); } }
I installed jQuery typing, so typescript will not complain that it will not recognize $. But now the fact is that the problem is in the question:
Error:(1679, 13) TS2403: Subsequent variable declarations must have the same type. Variable '$' must be of type 'JQueryStatic', but here has type 'cssSelectorHelper'.
This problem occurs because angular -protractor also declares $, but like cssSelectorHelper instead of a JQueryStatic object.
Thing is ... I donβt use protractor at all !!!, why is it added when I import something from angular2 / code? Is there a suitable solution for this until the Angular guys fix it if they ever will.
Note: commenting on the definition in the protractor file is not a suitable workaround, I am looking for something permanent that will not disappear when someone else takes the project and starts a clean installation or when we update the Angular library.
angular typescript
Langley
source share