Passing data between components without @Input/@Output

前端 未结 1 785
独厮守ぢ
独厮守ぢ 2020-12-19 17:34

In a nutshell, I need a \"shopping cart\" like relationship from one component to the rest of the site. I say \"shopping cart like\" because it\'s basically a list of needs

相关标签:
1条回答
  • 2020-12-19 17:59

    Make use of Angular Services they are one of passing data between components and also easy as Input and Output you will get stuck in a Spaghetti of event emitters , also you can look at the ngrx store for holding data in one place. but i would suggest you to use ngrx only in case of medium to large scale apps as it adds up a bit of code.

    My repo that has used both these concepts in details https://github.com/rahulrsingh09/AngularConcepts

    0 讨论(0)
提交回复
热议问题