import { Component, OnInit } from '@angular/core'; import { SharedService } from '../../services/shared.service'; @Component({ // tslint:disable-next-line: component-selector selector: 'app-ibar', templateUrl: './ibar.component.html', }) export class IbarComponent implements OnInit { constructor( public sharedService: SharedService, ) { } ngOnInit() { } public loadScript(url: string) { // tslint:disable-next-line: whitespace const body = document.body as HTMLBodyElement; const script = document.createElement('script'); script.src = url; body.appendChild(script); } public loadScriptText(scripts: string) { const body = document.body as HTMLBodyElement; const script = document.createElement('script'); script.text = scripts; body.appendChild(script); } }