you would use a @Directive and inject ElementRef here's an example https://github.com/gdi2290/ng-vegas-angular2-d3/blob/master/app.ts#L10 ( the version of typescript I'm using messed up the param types so I had to manually inject ElementRef In your case in the future you would only need to do constructor(elementRef: ElementRef) { )
On Monday, May 4, 2015 at 9:02:08 PM UTC-7, Anatoly wrote: > > Hi! > > Trying to play with Angular 2 (using TypeScript) here... understood that > it's still in alpha. > > How do I access DOM elements from Component? Specifically, I would like to > use a third-party widget such as CodeMirror <http://codemirror.com/> in > my Angular 2 app. Any idea where to start? > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
