Add System component with table display for custom and all beans
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SystemService } from './system.service';
|
||||
|
||||
describe('SystemService', () => {
|
||||
let service: SystemService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(SystemService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {Observable} from 'rxjs';
|
||||
import {Tutorial} from '../models/tutorial.model';
|
||||
import {Bean} from '../models/Bean';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SystemService {
|
||||
|
||||
baseUrl : string = 'http://localhost:8080/api/system';
|
||||
constructor(private http: HttpClient) { }
|
||||
|
||||
getAllBeans(): Observable<Bean[]> {
|
||||
return this.http.get<Bean[]>(this.baseUrl+"/beans");
|
||||
}
|
||||
|
||||
getCustomBeans(): Observable<Bean[]> {
|
||||
return this.http.get<Bean[]>(this.baseUrl+"/beans/custom");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user