1
我試圖用(<HTMLInputElement>document.getElementById("workflow")).src
替換URL
但我認爲這不是正確的做法。通過在Angular 2中DOM更改iframe url的更好方法
也嘗試了下面的代碼,但它給我getElementById
未定義。
import { Component, ElementRef, Inject } from '@angular/core';
constructor(private elementRef: ElementRef){}
this.elementRef.nativeElement.document.getElementById("workflow").src = "./javascript/workfloweditor.html?title="+workFlowTitle;
有人可以指出如何在Angular 2中正確地做到這一點嗎?
謝謝,這將這個答案。 – nCore