Commit a5defe55 authored by Open Source Developer's avatar Open Source Developer

perfecture

parent 9102fd78
...@@ -55,8 +55,11 @@ import { ...@@ -55,8 +55,11 @@ import {
private CoursesPerPerfSub: Subscription; private CoursesPerPerfSub: Subscription;
private StudentsSize$: BehaviorSubject<any>; private StudentsSize$: BehaviorSubject<any>;
private StudentsSizeSub: Subscription; private StudentsSizeSub: Subscription;
public perfecture = 1; public perfecture ;
private regionActive = <number>-1; private regionActive = <number>-1;
private School$: BehaviorSubject<any>;
private SchoolSub: Subscription;
constructor(private fb: FormBuilder, constructor(private fb: FormBuilder,
...@@ -67,6 +70,7 @@ import { ...@@ -67,6 +70,7 @@ import {
this.LimitPerCateg$ = new BehaviorSubject([{}]); this.LimitPerCateg$ = new BehaviorSubject([{}]);
this.CoursesPerPerf$ = new BehaviorSubject([{}]); this.CoursesPerPerf$ = new BehaviorSubject([{}]);
this.StudentsSize$ = new BehaviorSubject({}); this.StudentsSize$ = new BehaviorSubject({});
this.School$ = new BehaviorSubject([{}]);
this.formGroup = this.fb.group({ this.formGroup = this.fb.group({
}); });
...@@ -77,6 +81,19 @@ import { ...@@ -77,6 +81,19 @@ import {
ngOnInit() { ngOnInit() {
this.SchoolSub = this._hds.getSchoolId().subscribe(x => {
this.School$.next(x);
console.log(x[0].id, "perfectureID");
this.perfecture = x[0].id;
},
error => {
this.School$.next([{}]);
console.log("Error Getting School");
},
() => console.log("Getting School "));
this.SchoolPerPerfSub = this._hds.getSchoolPerPerfecture(this.perfecture).subscribe(data => { this.SchoolPerPerfSub = this._hds.getSchoolPerPerfecture(this.perfecture).subscribe(data => {
this.SchoolsPerPerf$.next(data); this.SchoolsPerPerf$.next(data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment