Skip to content

Commit

Permalink
new cm
Browse files Browse the repository at this point in the history
  • Loading branch information
duykypaul committed Apr 9, 2019
1 parent b16b806 commit c189b06
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions Management/src/app/exams/list/list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ export class ListComponent implements OnInit {
this.allItems.map(value => {
if (value._id === submitedExam._id) {
isAdd = false;
value.name = submitedExam.name;
value.status = submitedExam.status;
value.special = submitedExam.special;
value.number_questions = submitedExam.number_questions;
Expand Down
7 changes: 5 additions & 2 deletions Management/src/app/subjects/form/form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,15 @@ export class FormComponent implements OnInit {
if (this.formSubject.valid) {
const subject: ISubject = this.formSubject.value;
subject._id = id;
this.currentSubject.emit(subject);
const copySubject = Object.assign({}, subject);
this.currentSubject.emit(copySubject);
console.log('this.currentSubject: ' + this.currentSubject);
console.log("subject: " + subject);
} else {
validateAllFormFields(this.formSubject);
}
this.edittingSubject = false;
this.ngOnInit();

}

reloadPageIfError() {
Expand Down
1 change: 1 addition & 0 deletions Management/src/app/subjects/list/list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class ListComponent implements OnInit, OnChanges {
let isAdd = true;
this.allItems.map(value => {
if (value._id === this.currentSubject._id) {
console.log('this.currentSubject._id: ' + this.currentSubject._id);
isAdd = false;
value.status = objSubject.status;
value.name = objSubject.name;
Expand Down
2 changes: 1 addition & 1 deletion Management/src/app/subjects/subjects.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ export class SubjectsComponent implements OnInit {
}
onSubmit(item: ISubject) {
this.currentSubject = item;
// console.log(this.currentSubject);
console.log(this.currentSubject);
}
}

0 comments on commit c189b06

Please sign in to comment.