Angular 2 và Angular 1 - Những điểm khác biệt
Chắc hẳn đổi với các front-end developer đều rất quen thuộc với Angular framework do Google đỡ đầu, một trong những framework javascript rấ...
Sẻ Chia Kiến Thức - Tiếp Cận Công Nghệ !
Chắc hẳn đổi với các front-end developer đều rất quen thuộc với Angular framework do Google đỡ đầu, một trong những framework javascript rấ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import {Component, View, ViewEncapsulation, Attribute} from 'angular2/angular2';
import {MdCheckbox} from "../checkbox/checkbox";
// itvovantien
// TODO(jelbourn): add gesture support
// TODO(jelbourn): clean up CSS.
@Component({
selector: 'md-switch',
inputs: ['checked', 'disabled'],
host: {
'role': 'checkbox',
'[attr.aria-checked]': 'checked',
'[attr.aria-disabled]': 'disabled_',
'(keydown)': 'onKeydown($event)',
}
})
@View({
templateUrl: 'package:angular2_material/src/components/switcher/switch.html',
directives: [],
encapsulation: ViewEncapsulation.None
})
export class MdSwitch extends MdCheckbox {
constructor(@Attribute('tabindex') tabindex: string) {
super(tabindex);
}
}
|
Những thay đổi chính là gì? Component sẽ là một khái niệm trung tâm; nghe vài nhận định rằng web component là tương lai của web, và Ang...