I would also caution against direct DOM access in Angular, but here is an example of how to do it:
import {Component, ElementRef, Inject, OnInit} from '@angular/core';
declare var jQuery:any;
@Component({
selector: 'jquery-integration',
templateUrl: './components/jquery-integration/jquery-integration.html'
})
export class JqueryIntegration implements OnInit {
constructor(private elementRef: ElementRef) {
}
ngOnInit() {
jQuery(this.elementRef.nativeElement).find('.moving-box').draggable({containment:'#draggable-parent'});
}
}
The key idea is to inject elementRef. You can then treat that as a regular DOM element. In my example here I am using jquery, but you can use standard DOM access as well.
More info: http://www.syntaxsuccess.com/viewarticle/using-jquery-with-angular-2.0