1
URL新しいタブで開こうとしているユーザーから動的に取得しているものですが、新しいURLタブで開くことができますが、localhost 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");
}
}
うまくいきました。ありがとうございます。 –
しかし、新しいウィンドウを開くときに現在のウィンドウがリロードされるという問題が1つあります。 –