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
Смотрите видео Using @Input and @Output in Angular онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Sebastian Persson 01 Январь 1970, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 2,079 раз и оно понравилось 34 людям.