Commit 54af895b by Natthaphat Pankiang

บังคับให้อัปเดต View ตอนเปิด Modal หน้า ทะเบียนส่วน ,ส่วนย่อย 2

parent 87d9dc4b
import { Component, EventEmitter, Input, OnInit, } from '@angular/core';
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { Bu2Model, MyBu2Model } from 'src/app/shared/model/bu2.model';
import { Bu3Model, MyBu3Model } from 'src/app/shared/model/bu3.model';
......@@ -37,7 +37,8 @@ export class SectionRegistrationComponent implements OnInit {
currentModal = ""
constructor(private bu3Service: Bu3Service,
private bu2Service: Bu2Service,
private toastr: ToastrService
private toastr: ToastrService,
private cdr: ChangeDetectorRef
) { }
ngOnInit(): void {
this.getBu3List()
......@@ -64,6 +65,7 @@ export class SectionRegistrationComponent implements OnInit {
if (this.bu3.parent) {
this.bu2Service.getById(this.bu3.parent).subscribe(response => {
this.bu2 = new MyBu2Model(response)
this.cdr.detectChanges()
})
}
}
......
import { Component, EventEmitter, Input, OnInit, } from '@angular/core';
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { Bu4Model, MyBu4Model } from 'src/app/shared/model/bu4.model';
import { Bu5Model, MyBu5Model } from 'src/app/shared/model/bu5.model';
......@@ -37,7 +37,8 @@ export class SubDepartmentTwoComponent implements OnInit {
currentModal = ""
constructor(private bu5Service: Bu5Service,
private bu4Service: Bu4Service,
private toastr: ToastrService
private toastr: ToastrService,
private cdr: ChangeDetectorRef
) { }
ngOnInit(): void {
this.getBu5List()
......@@ -64,6 +65,7 @@ export class SubDepartmentTwoComponent implements OnInit {
if (this.bu5.parent) {
this.bu4Service.getById(this.bu5.parent).subscribe(response => {
this.bu4 = new MyBu4Model(response)
this.cdr.detectChanges()
})
}
}
......
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