typescript 轮播数据服务
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typescript 轮播数据服务相关的知识,希望对你有一定的参考价值。
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { environment } from '../../environments/environment';
import { ICategory } from '../models/icategory';
import { IAlbum } from '../models/ialbum';
@Injectable()
export class CarouselDataService {
constructor(private http: HttpClient) {}
getCategories(): Observable<ICategory[]> {
return this.http.get<ICategory[]>(environment.categoriesApiUrl);
}
getAlbums(): Observable<IAlbum[]> {
return this.http.get<IAlbum[]>(environment.albumsApiUrl);
}
}
以上是关于typescript 轮播数据服务的主要内容,如果未能解决你的问题,请参考以下文章