Closed fnlctrl closed 9 years ago
Problem solved by getting the number from parent vm, instead of child components.
The proper way is to set a prop number
and a watch
within tab
:
number
gets data from vm, while watch
$dispatch new values upwards to tabs
Consider this example:
that gets rendered as
Now, as the
tabs
need child component's data to display the numbers, and the numbers are fetched from api (so the data should be two-way binded), what is the proper way to get it?Using props + callbacks needs to define a prop inside each child component, Using directives won't get the data binded...
The only way I can think of now, is setting up watches inside each child component, that $dispatchs the new value upwards..