本文整理匯總了TypeScript中common.ArticleService類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ArticleService類的具體用法?TypeScript ArticleService怎麽用?TypeScript ArticleService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ArticleService類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
this.activatedRoute.params.subscribe((params: any) => {
this.articleUrl = params.id;
this.articleService.getArticleByUrl(this.articleUrl)
.subscribe(result => {
this.article = result;
});
});
示例2: updateMarkdown
updateMarkdown(): void {
this.articleService
.updateMarkdown(this.articleUrl, Object.assign({}, this.article, { markdown: this.mdArticle }))
.subscribe(t => {
setTimeout(() => this.rebirthWindow.getGlobalObject().alert(`${this.article.title}修改成功`));
});
}
示例3: pageChange
pageChange(pageIndex) {
this.articleService.getArticles(pageIndex, config.article.pageSize)
.subscribe(result => {
this.article = result;
this.rebirthWindow.scrollToTop(this.elmRef);
}, (e) => console.log(e, 'ArticleListComponent error'));
}
示例4: getItems
getItems(pageIndex: number): Observable<SearchResult<Article>> {
return this._ser.getArticles(pageIndex, config.article.pageSize);
}
示例5: ngOnInit
ngOnInit() {
this.articleService.getArticles(1, 5)
.subscribe(result => {
this.article = result;
});
}