Created
June 13, 2020 07:12
-
-
Save nathanwoulfe/7e225ded78e25b2db6566fe10ed189f0 to your computer and use it in GitHub Desktop.
How clean are my children?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.workflowResource.saveNodeConfig(this.node.id, this.approvalPath, this.variant) | |
.then(() => { | |
this.notificationsService.success('SUCCESS', 'Workflow configuration updated'); | |
this.$rootScope.$broadcast('configUpdated'); | |
this.$scope.contentFlowForm.$setPristine(); | |
// shouldn't need to do this... | |
// check that all child forms of the contentForm are pristine, then reset contentForm | |
let parentPristine = this.$scope.contentFlowForm.$$parentForm.$$controls | |
.filter(c => Object.prototype.hasOwnProperty.call(c, '$submitted')) | |
.every(x => x.$dirty === false); | |
if (parentPristine) { | |
this.$scope.contentFlowForm.$$parentForm.$setPristine(); | |
} | |
}, err => this.notificationsService.error('ERROR', err)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment