I am using LightGallery to display user pictures. How use LightGallery in angular 2 ?.
Asked
Active
Viewed 1,084 times
2
-
1here 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 Answers
0
- Install jQuery Typings in project: tsd install jQuery
- Load jQuery with script tag ( or other loaders... )
- 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