Change error clearing to occur on input change

master
trivernis 5 years ago
parent f9ef6c2669
commit 454917efdd

@ -7,7 +7,7 @@ infinite-scroll
<mat-card >
<mat-card-content>
<mat-form-field id="input">
<textarea matInput #content type="text" [(ngModel)]="textInputValue" mat-autosize="true" matAutosizeMaxRows="3" placeholder="post something"></textarea>
<textarea matInput #content type="text" (input)="onTextInputChange()" [(ngModel)]="textInputValue" mat-autosize="true" matAutosizeMaxRows="3" placeholder="post something"></textarea>
<button mat-button matSuffix mat-icon-button>
<mat-icon>add</mat-icon>
</button>

@ -49,9 +49,6 @@ export class FeedComponent implements OnInit {
});
this.feedService.getPosts('NEW');
this.feedService.posts.subscribe(response => {
if (response.length > 0) {
// this.loading = false;
}
this.parentSelectedPostList = response;
});
this.feedService.newPostsAvailable.subscribe(response => {
@ -104,4 +101,14 @@ export class FeedComponent implements OnInit {
getErrorMessage() {
return this.errorMessage;
}
/**
* Executed when the text in the input field changes.
*/
private onTextInputChange() {
if (this.errorOccurred) {
this.errorOccurred = false;
this.errorMessage = '';
}
}
}

Loading…
Cancel
Save