【发布时间】:2017-10-17 00:55:46
【问题描述】:
我试图在新标签页中打开的用户动态获取的 URL,它在新标签页中打开,但 localhost url 与动态 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");
}
}
【问题讨论】:
标签: angular