本文整理匯總了TypeScript中rebirth-common.RebirthWindow類的典型用法代碼示例。如果您正苦於以下問題:TypeScript RebirthWindow類的具體用法?TypeScript RebirthWindow怎麽用?TypeScript RebirthWindow使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了RebirthWindow類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(private elmRef: ElementRef, private renderer: Renderer, private rebirthWindow: RebirthWindow) {
let protocol = this.rebirthWindow.getOwnerDocument(this.elmRef).location.protocol === 'https:' ? 'https:' : 'http:';
this.duoShuoUrl = `${protocol}//static.duoshuo.com/embed.js`;
this.rebirthWindow.getGlobalObject().duoshuoQuery = { short_name: "greengerong" };
}
示例2: ngOnInit
ngOnInit() {
let duoshuoElm = this.elmRef.nativeElement.querySelector('.ds-thread');
this.rebirthWindow.createScript(`${this.duoShuoUrl}?rn=${Math.random()}`,
this.renderer, this.elmRef, () => {
this.rebirthWindow.getGlobalObject().DUOSHUO.EmbedThread(duoshuoElm);
});
}
示例3: setTimeout
setTimeout(() => this.rebirthWindow.getGlobalObject().alert(`${this.article.title}修改成功`));
示例4:
this.renderer, this.elmRef, () => {
this.rebirthWindow.getGlobalObject().DUOSHUO.EmbedThread(duoshuoElm);
});
示例5:
.subscribe(result => {
this.article = result;
this.rebirthWindow.scrollToTop(this.elmRef);
}, (e) => console.log(e, 'ArticleListComponent error'));