constructor()
- The view-model's constructor is called first.- created(owningView: View, myView: View)
The created callback will receive the instance of the "owningView".
This is the view that the component is declared inside of.
If the component itself has a view, this will be passed second.
owningView是这个组件要在哪个View里面渲染,myView是自己的view。如果有自己的view,这个owningView
就会被变成第二顺位。
3.bind(bindingContext: Object, overrideContext: Object)
If the view-model has a
bind
callback, it will be invoked at this time.
The "binding context" to which the component is being bound will be passed first.
An "override context" will be passed second.
4.
attached()
- Next, the component is attached to the DOM (in document).
If the view-model has an
attached
callback, it will be invoked at this time