-
-
Save mohamedaboelmagd/a681e69e515cf3df2aaf19566094196e to your computer and use it in GitHub Desktop.
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
@Component({ | |
template: ` | |
<form> | |
... | |
<button (click)="submit()" *ngIf="isDirty$ | async">Save</button> | |
</form> | |
` | |
}) | |
export class SettingsComponent { | |
settings = new FormGroup({...}); | |
isDirty$: Observable<boolean>; | |
ngOnInit() { | |
this.isDirty$ = this.settings.valueChanges.pipe( | |
dirtyCheck(store$), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment