2

I am using LightGallery to display user pictures. How use LightGallery in angular 2 ?.

ranjeet
  • 540
  • 7
  • 16
  • 1
    here is how to use jquery with angular2 . . . follow the same approach. http://stackoverflow.com/questions/30623825/how-to-use-jquery-with-angular2 – mehari Aug 05 '16 at 14:30

1 Answers1

0
  1. Install jQuery Typings in project: tsd install jQuery
  2. Load jQuery with script tag ( or other loaders... )
  3. Wrap any jQuery plugin with Angular 2 Directive

Example:

@Directive({
  selector: "[light-gallery]"
})
export class LightGallery{
  constructor(el: ElementRef) {
    jQuery(el.nativeElement).lightGallery();
  }
}

Then use the above directive in your angular 2 components.

null canvas
  • 10,201
  • 2
  • 15
  • 18