attribute
- [router-outlet]: child module space
- module-event-click: click event
- value: method name, parameter($event, View)
<button module-event-click="changeData">change</button>
- module-event-change: change event
- value: method name, parameter($event, View)
<input module-event-change="changeData">
- module-event-keyup: keyup event
- value: method name, parameter($event, View)
<input module-event-keyup="changeData">
- module-event-keydown: keydown event
- value: method name, parameter($event, View)
<input module-event-keydown="changeData">
- module-event-input: input event
- value: method name, parameter($event, View)
<input module-event-input="changeData">
- module-value-link: link event (value change <-> input)
<input module-value-link="value">
- module-value: value injection
<input module-value="value">
- module-change-attr: change value setAttribute
- script
- it: detect variable value
- attribute: element attribute
<img src="https://cdn.imweb.me/thumbnail/20190912/460132b4e4fce.jpg" module-change-attr="return {height: it, width: it}">
- module-change-style: change value set Style
- script
- it: detect variable value
- style: element style
<div module-change-style="return {fontSize: `${it}px`, color: this.randomColor()}">hello</div>
- router-active-class: url === href attribute => class add
- value: add and remove class name
<a router-link="ajax" router-active-class="['active']">Ajax</a>
<a router-link="ajax">Ajax</a>
- module-event-{{eventName}}-intent-publish: intent publish
- value: ['uri', 'variablename'] or ['uri']
- publish
click event intent publish:
<button class="btn btn-primary" module-event-click-intent-publish="['layout://info/data?a=wow&aa=ppp','makeRandom']">publish data</button>
typing:
<input type="text" module-event-keyup-intent-publish="['layout://info/viewSubscribe?a=wow&aa=vvv']">
data(i: Intent) {
this.datas = i.data + '->' + i.params.aa
}
viewSubscribe(i: Intent<View<HTMLInputElement>>) {
this.datas = i.data?.value + '->' + i.params.aa + '-->' + i.event
}