0

I want to use a library like chart.js or d3.js inside angular 2. I understand how to make it work by passing them an ElementRef, but that would bypass the renderer. Is there any way (apart from rewriting chart.js or d3.js) to make the DOM manipulation of such libraries go through the angular 2 renderer so that server side rendering is still possible?

If not, I still want to prerender most of my page on the server. What would be the best way to detect if you're running in an environment where direct DOM manipulation isn't possible so that you can skip rendering certain directives?

1 Answer 1

0

If not ...

I guess

DOM instanceOf BrowserDomAdapter 

should give you this information.

There is an issue currently though https://github.com/angular/angular/issues/6904

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.