Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72443

Display DOM document in Angular component

$
0
0

I try to draw a line with leadr-line(https://www.npmjs.com/package/leader-line) between two dots, but the line is diplayed in the background instead of component view enter image description here

import {DOCUMENT} from '@angular/common';
import 'leader-line/leader-line.min';
declare const LeaderLine: any;
@Component({
selector: 'app-component1',
 })
export class Component1 implements OnInit{
constructor(@Inject(DOCUMENT) private document) {
}

createLine(){
 const line = new LeaderLine(
    this.document.getElementById('remainder'),
    this.document.getElementById('button0')
  )
}

}

this component is used in another component

@Component({
selector: 'app-component2',

})
export class Component2 implements OnInit {

constructor() { }

ngOnInit() {
}

<tab>

  <app-component1>

  </app-component1>
</tab>

Viewing all articles
Browse latest Browse all 72443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>