What is the difference between @ViewChild and @input?

Forums AngularWhat is the difference between @ViewChild and @input?
Staff asked 2 years ago

Answers (1)

Add Answer
prinkesha lathidadiya Marked As Accepted
Staff answered 2 years ago

A component in Angular can communicate data with its parent or child components using the decorators @Input() and @Output(), respectively. A component can access a child component, directive, or DOM element with the decorator @ViewChild().

Subscribe

Select Categories