seedog | Hyper master data manager for activerecord | Application Framework library
kandi X-RAY | seedog Summary
kandi X-RAY | seedog Summary
Hyper master data manager for activerecord.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Run the config file
- Creates a new model .
- Create a transaction
seedog Key Features
seedog Examples and Code Snippets
Community Discussions
Trending Discussions on seedog
QUESTION
I have 2 components in an Angular app (for learning purposes) and one service.
I want to pass data from component1 to component2 (siblings) and I created a service.
I iterated a hardcoded object array with a ngFor
and just want to display in the second component the same name I clicked on component 1. it's extremely simple but I'm learning :)
This is the component 1 TS code:
...ANSWER
Answered 2021-Feb-16 at 18:11Great start! The missing piece here, or the reason why this is not working, is that in the second component, you are initializing the value in the onInit
, which is a one-time execution. So when the second component loads, the value of selectedPerrin
is initialized, and it's initialized to undefined
since that's what the value of selectedPerrin
is at that point in time.
For this to work, you would need to apply some observables, so that you have a stream of events:
- In the service, make the
selectedDogForService
aSubject
orBehaviorSubject
:selectedDogForService = new BehaviorSubject(null);
- In the first component, instead of assigning the value, "push" a new value like so:
this.dogservice.selectedDogForService.next('dog')
. - In the second component, use the
async
pipe to read the value:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install seedog
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page