1
Url我從用戶動態獲得的信息,我試圖在新選項卡中打開,它在新選項卡中打開,但本地主機url正在隨動態url一起追加。新的URL正在追加localhost url
@Injectable()
export class WindowRef {
constructor() {}
getNativeWindow() {
return window;
}
}
export class UrlTab implements OnInit{
constructor(private winRef: WindowRef) {
this.nativeWindow = winRef.getNativeWindow();
}
//method getting called on click of <a></a> from html
assignActity(type: string): void {
var newWindow = this.nativeWindow.open("www.gmail.com");
}
}
它的工作,謝謝。 –
但有一個問題是當前窗口在重新打開新窗口時重新加載。 –