Friday, 4 January 2019

What is the right way to implement a 3rd party library that manipulates the Dom?

I am using a 3rd party library to render a widget onto the screen (Okta's SignInWidget). The way the widget is rendered is so:

this.oktaSignInWidget.renderEl(
    { el: '#widget-container' },
    () => {},
    err => {
      console.error(err);
    }
  );

My initial thought was to put this into a directive, but even with directives you are supposed to let Renderer2 do the rendering. Is there a best practice here?



from What is the right way to implement a 3rd party library that manipulates the Dom?

No comments:

Post a Comment