We have a lot component interaction in my project through @Input and @output annotations. With the recent upgrade from angular 9 & 10 from angular 8 am facing few errors on passing the value to the @input annotation:
<mc-header-bar [(headerModel)]="headerModel" ></mc-header-bar>
Error message : Type 'Event' is not assignable to type 'HeaderBar'
headerModel looks like below:
headerModel: HeaderBar = new HeaderBar('Home', '', false, '', false);
In angular 8 this code has no issue and used to work fine. when i remove two way binding to one way binding i dont see the error.
[(headerModel)]="headerModel" -----> [headerModel]="headerModel"
is two way binding [()] won't work on passing to @input now ?
@Component({
selector: 'mc-header-bar',
templateUrl: './header-bar.component.html',
styleUrls: ['./header-bar.component.scss']
})
export class HeaderBarComponent implements OnInit, AfterViewInit, OnDestroy {
/**
* Input model for displaying the header bar
*/
@Input() headerModel: HeaderBar;
Help Appreciated !