Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this.SVG causes runtime error in Angular #95

Open
estanglerbm opened this issue Mar 16, 2021 · 0 comments
Open

this.SVG causes runtime error in Angular #95

estanglerbm opened this issue Mar 16, 2021 · 0 comments

Comments

@estanglerbm
Copy link

The code "this.SVG =" causes runtime error when using html-query-plan in Angular.

A workaround is to comment this out in qp.js / qp.min.js. So going from this:

var SVG = this.SVG = function(element) {

to this:

var SVG = /*this.SVG =*/ function(element) {

Functionality seems the same. If this code really isn't necessary, it would be nice for the npm install to have this fix.

FYI, one way to use html-query-plan in Angular is to do:

  1. npm install html-query-plan
  2. Manually fix-up qp.js / qp.min.js, as above.
  3. In the component using it, add to the top: import * as QP from 'html-query-plan';
  4. In styles.scss, add: @import '~html-query-plan/css/qp.css';
  5. Add the plan with:
var container:HTMLElement | null = document.getElementById("MyContainer");
if( container ) {

	QP.showPlan( container, planXMLText );
}
  1. Make sure not to add anything else in the container (i.e. through container.innerHTML), or you lose tooltips.
  2. The build will automatically have everything needed (i.e. qp_icons).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant