San components provide event mechanism. By calling fire method child component can dispatch a custom event, which will be received by the parent component via the on-“event name” directive or on method on the child component instance. That is child-to-parent component messaging.
Usage
1 | var childComponent = san.defineComponent({ |
Note: Two-way data binding can also achieve child-to-parent messaging. But it’s not recommended to notify the parent component using two-way data binding other than use cases like form components.
Demo
See the Pen child-to-parent by funa (@naatgit) on CodePen.