2016-10-04 4 views

답변

0

귀하는 모달을 마감하고 있습니다. 그래서, close 함수에서 값을 재설정하는 코드를 넣으십시오. modalsComponent을 사용하는 경우 lifCycle 후크 ngOnDestroy을 사용하여 값을 재설정 할 수 있습니다. 희망, 이것이 도움이된다.

0

귀하의 질문에 대한 설명이 매우 부족합니다. 그러나 왜 직접적인 방법을 사용하지 않고 사용자가 모델 사본과 상호 작용하게할까요? 일부 의사 코드 :

function onOpen() { 
    this.tempModel = Object.assign({}, this.realModel); 
    //or if you modal creates a new entity 
    //this.tempModel = {}; 
} 

function onReset() { 
    //do nothing 
} 

function onSave() { 
    this.realModel = this.tempModel 
} 
관련 문제