ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.04k stars 1.2k forks source link

Angular 2? #568

Open ghost opened 8 years ago

ghost commented 8 years ago

is there any possibility yet to use gridster with angular2?

steven-fernandez commented 8 years ago

Hope the answer is yes :)

EmilyADaniel commented 8 years ago

I've been trying to implement it, but I'm running into trouble getting it to see the selector. My component code currently looks like this; `export class AppComponent { elementRef: ElementRef;

constructor (elementRef: ElementRef) {
    this.elementRef = elementRef;
}

ngAfterViewChecked() {
    jQuery(this.elementRef.nativeElement).gridster({ el: '.gridster ul', widget_margins: [10, 10], widget_base_dimensions: [140, 140]});
}

}`

And the HTML is the standard test HTML from the gridster site. Presumably something is wrong with my constructor, but using it in its original fashion from the site leads to tons of errors. Is it actually just incompatible with Angular 2 at this point, or is there something I can do?