[Angular] How to pass data from bootstrap modal to component angular which is inside the modal

98 views
Skip to first unread message

Neha Yargal

unread,
Oct 21, 2020, 10:55:32 AM10/21/20
to ang...@googlegroups.com
Hi, 

I have used bootstrap modal, it will open on the click of button(which is in component A). modal has content from another component(component B). The question is how to pass data(id) from component A to component B which is inside the modal. please refer to the below image.
image.png
Thanks.
Regards,
Neha

Rahul Mishra

unread,
Oct 21, 2020, 11:07:26 AM10/21/20
to ang...@googlegroups.com
You can write your logics and showing of data in component B and and you can use input parameter to pass your data from component A to B or else you can use service .

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angular/CACCTogd-aYWriLOTJmYcxBxaxMN1%3DeHuZCzGZmdgNewDs_RXKA%40mail.gmail.com.

Neha Yargal

unread,
Oct 21, 2020, 11:12:32 AM10/21/20
to ang...@googlegroups.com
I tried @Input property and service as well but it's giving undefined data.

Rahul Mishra

unread,
Oct 21, 2020, 11:55:25 AM10/21/20
to ang...@googlegroups.com
May be initialisation issue. Can say only if get to see the code. Otherwise it should work.

Reply all
Reply to author
Forward
0 new messages