从"Blog"仓库中分离出来

This commit is contained in:
小海
2019-11-28 19:26:45 +08:00
commit c2aaf280db
616 changed files with 104128 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import {Injectable} from '@angular/core';
import {HttpService} from '../http.service';
import {Count} from '../../class/count';
@Injectable({
providedIn: 'root'
})
export class CountService {
constructor(public http: HttpService) {
}
count: Count;
getCount() {
const observable = this.http.get('/counts');
observable.subscribe((data: any) => {
if (data.code === 0) {
this.count = data.result;
}
});
return observable;
}
}