I have 2 components:
One which contain a
router-outlet
where will be injected pages with a question and 3 possible answersSecond that is a sort of preview, that contains 20 boxes I use a shared service(BehaviorSubject) for components communication
WHAT I DO IS THIS:
- when user choose an answer from
/question1
route, I use the service to emit a unique value(every answer have a unique value) - in the preview component I've subscribed to whatever service emits, and I know exactly what question is and what answer is submitted
- now, accordingly to that specific answer I need to animate a specific box from this second component
MY QUESTION IS:
How do I apply a generic animation for that specific box. I don't want to create 20 different animations with different names, or 20 unique variables that will have true or false values. I want a way to target a box and apply my animation