whether to use BehaviorSubject or Session Storage

Discussão em 'Angular' iniciado por shaik salma, Outubro 27, 2024.

  1. shaik salma

    shaik salma Guest

    I am building an angular Application where I have product dropdown component which contains two dropdowns and I will be calling this component in many parent components and If I change the dropdown in one component then when i navigate to other components this hange should be reflected. for this I am connfused to whether to use only session Storage or combination of session Storag and Behaviour Subbject becuse at one time only one main component will be opened.

    so i am thinking to use session storage and in ngOnInit take the Item from Session Storage. will this approach will be correct?

    Continue reading...

Compartilhe esta Página