Hi guys, I am confused about the data passing between the main page, and its components. Here is the example, I have this page call restaurant.ts, and inside it, I have 3 to 4 components like restaurant-detail-main.component.ts, restaurant-detail-info.component.ts.
I have a provider which has the whole array of object which contain only one restaurant, like
public restaurant: [
restaurantName: ‘Super Nice Cafe’
Okay, here is the main question in my mind,
- should I just inject the provider one time in the main restaurant.ts, and pass array to components.
- Or should I inject every time I need the data, whether in components or pages.
Appreciate your advice