Refine expression.

This commit is contained in:
kunw 2017-04-06 15:05:48 +08:00
parent a6f88aaac8
commit 26a2582553
2 changed files with 2 additions and 2 deletions

View File

@ -209,7 +209,7 @@ export class CreateEditDestinationComponent implements AfterViewChecked {
for(let i in data) { for(let i in data) {
let current = data[i]; let current = data[i];
let origin = this.initVal[this.mappedName[i]]; let origin = this.initVal[this.mappedName[i]];
if(this.actionType === ActionType.EDIT && this.editable && !current || current && current !== origin) { if((this.actionType === ActionType.EDIT && this.editable && !current) || (current && current !== origin)) {
this.hasChanged = true; this.hasChanged = true;
break; break;
} else { } else {

View File

@ -293,7 +293,7 @@ export class CreateEditPolicyComponent implements OnInit, AfterViewChecked {
for(let i in data) { for(let i in data) {
let origin = this.initVal[i]; let origin = this.initVal[i];
let current = data[i]; let current = data[i];
if(this.actionType === ActionType.EDIT && !this.readonly && !current || current && current !== origin) { if((this.actionType === ActionType.EDIT && !this.readonly && !current) || (current && current !== origin)) {
this.hasChanged = true; this.hasChanged = true;
break; break;
} else { } else {