feat(Directive): Have a single Directive.host which mimics HTML
fixes #2268 BREAKING CHANGE: Before @Directive({ hostListeners: {'event': 'statement'}, hostProperties: {'expression': 'hostProp'}, hostAttributes: {'attr': 'value'}, hostActions: {'action': 'statement'} }) After @Directive({ host: { '(event)': 'statement', '[hostProp]': 'expression' // k & v swapped 'attr': 'value', '@action': 'statement' } })
This commit is contained in:
committed by
Tobias Bosch
parent
47b6b05017
commit
f3b49378e4
@@ -9,9 +9,12 @@ import {NumberWrapper} from 'angular2/src/facade/lang';
|
||||
@Component({
|
||||
selector: 'md-switch',
|
||||
properties: ['checked', 'disabled'],
|
||||
hostListeners: {'keydown': 'onKeydown($event)'},
|
||||
hostProperties:
|
||||
{'checked': 'attr.aria-checked', 'disabled_': 'attr.aria-disabled', 'role': 'attr.role'}
|
||||
host: {
|
||||
'(keydown)': 'onKeydown($event)',
|
||||
'[attr.aria-checked]': 'checked',
|
||||
'[attr.aria-disabled]': 'disabled_',
|
||||
'[attr.role]': 'role'
|
||||
}
|
||||
})
|
||||
@View({templateUrl: 'angular2_material/src/components/switcher/switch.html', directives: []})
|
||||
export class MdSwitch {
|
||||
|
||||
Reference in New Issue
Block a user