I am binding input element with model property in angular 5
<input [(ngModel)]="MB.YearOfOperation | date: 'dd-MMM-yyyy' " type="text" class="form-control">
Using date pipe to format its value but it gives error
Cannot have a pipe in an action expression at column 33
so I tried below approach with (ngModelChange)
<input [(ngModel)]="MB.YearOfOperation | date: 'dd-MMM-yyyy' " (ngModelChange)="MB.YearOfOperation =$event" type="text" class="form-control">
But still it give the same error , How can I use pipes with [(ngModel)] ??