get value from another component angular 4

后端 未结 3 1044
孤城傲影
孤城傲影 2020-12-25 08:18

I have two separate components; a header component containing a select search box, stats component that shows the results depending on the value of the select box, I was won

3条回答
  •  太阳男子
    2020-12-25 09:21

    I think that the best for your case would be to use service for communication between components.

    Check out example in Angular documentation: https://angular.io/guide/component-interaction#parent-and-children-communicate-via-a-service

提交回复
热议问题