本文整理汇总了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;
});
}