These are chat archives for AngularClass/angular2-webpack-starter

1st
Feb 2016
Uros Lates
@uroslates
Feb 01 2016 09:30
This message was deleted
adyster
@adyster
Feb 01 2016 10:00
I can't get jQuery to work. Can't seem to find any reference online about it. Get the following error: TS2403: Subsequent variable declarations must have the same type. Variable '$' must be of type 'cssSelectorHelper', but here has type 'JQueryStatic'.
Any ideas? :worried:
Branislav
@djuric42
Feb 01 2016 13:39
@adyster go to typings/jquery/jquery file
and there change
at the end of file jquery.d.ts
declare module "jquery" {
export = jQuery;
}
declare var jQuery: JQueryStatic;
that is proper way to declare module so that you can call it from angular app
and then call it from your component like this
/// <reference path='../../../../typings/jquery/jquery.d.ts' />
sorry define it like that
weird syntacs but it works
and then you can declare it something like this
declare var jQuery: JQueryStatic;
adyster
@adyster
Feb 01 2016 13:47
Ok.. thanks. I'll give it try! :smile:
Branislav
@djuric42
Feb 01 2016 13:56
sure
Marco Emnanuel PatiƱo Acosta
@markdrake
Feb 01 2016 22:27
Hey guys, how can I declare a class constant in typescript? E.g.
class SomeClass {
  const SOME_CONSTANT='value';
}
Nuno Monteiro
@nfmmonteiro
Feb 01 2016 22:49
@markdrake: here's how I would define it
class HttpStatusCodes {
public static get OK():number { return 200; }
public static get ACCEPTED():number { return 201; }
public static get NOT_FOUND():number { return 404; }
public static get INTERNAL_SERVER_ERROR():number { return 500; }
}
console.log(HttpStatusCodes.ACCEPTED) will log 201