This video explains data communication in Angular between parent-to-child component and child-to-parent component. The most common and effective way to communicate from the parent-to-child component is through Input decorators. With the input decorator, you can pass in pretty much anything that you would prefer the child component to have. The Input decorator should be passed in from the HTML of the parent component. In a very similar way to the Input decorator, you can communicate back from the child to the parent component. The Output decorator should be of the type EventEmitter (make sure it's imported from @angular/core, otherwise it won't work as excepted). Once that is set up, you need to emit a value and listen for it in the parent component.
#Angular #DataCommunication #JavaScript #input #typescript
My portfolio:
http://sebastianpersson.com/
My LinkedIn:
/ sebastianpersson
Watch video Using @Input and @Output in Angular online, duration hours minute second in high quality that is uploaded to the channel Sebastian Persson 01 January 1970. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 3,081 times and liked it 45 visitors.