File tree Expand file tree Collapse file tree 5 files changed +36
-7
lines changed Expand file tree Collapse file tree 5 files changed +36
-7
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,33 @@ public getCheckProp() {
55
55
56
56
```
57
57
58
- ### Angular Usage Help:
59
- [ Here] ( https://github.com/bradmartin/nativescript-drawingpad#angular ) is a sample on using UI components in Angular Native (NativeScript + Angular2)
58
+ ### Angular Usage Sample:
59
+
60
+ ``` typescript
61
+ import { CheckBox } from ' nativescript-checkbox' ;
62
+ import { registerElement } from " nativescript-angular/element-registry" ;
63
+ registerElement (" CheckBox" , () => require (" nativescript-checkbox" ).CheckBox );
64
+
65
+ export class SomeComponent {
66
+ @ViewChild (" CB1" ) FirstCheckBox: ElementRef ;
67
+ constructor () {}
68
+ public toggleCheck() {
69
+ this .FirstCheckBox .nativeElement .toggle ();
70
+ }
71
+
72
+ public getCheckProp() {
73
+ console .log (' checked prop value = ' + this .FirstCheckBox .nativeElement .checked );
74
+ }
75
+ }
76
+ ```
77
+
78
+ ``` html
79
+ <StackLayout >
80
+ <CheckBox #CB1 text =" CheckBox Label" checked =" false" ></CheckBox >
81
+ <Button (tap) =" toggleCheck()" text =" Toggle it!" ></Button >
82
+ <Button (tap) =" getCheckProp()" text =" Check Property" ></
83
+ </StackLayout >
84
+ ```
60
85
61
86
## Properties
62
87
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ ActionBar {
10
10
color : # fff ;
11
11
}
12
12
13
+ .tab-item {
14
+ color : # fff ;
15
+ background-color : # fff000 ;
16
+ }
17
+
13
18
14
19
# wrapper {
15
20
padding : 10 ;
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ ListView{
11
11
.list-check {
12
12
font-weight : bold;
13
13
font-size : 14 ;
14
- color : black;
15
14
margin : 2% , 0 , 2% , 2% ;
16
15
}
17
16
Original file line number Diff line number Diff line change 3
3
xmlns : CheckBox =" nativescript-checkbox" loaded =" pageLoaded" >
4
4
<ActionBar title =" Native Checkbox" />
5
5
6
- <TabView id =" tabViewContainer" >
6
+ <TabView id =" tabViewContainer" selectedColor = " #fff " tabsBackgroundColor = " #336699 " >
7
7
<TabView .items>
8
8
<TabViewItem title =" General" class =" tab-item" >
9
9
<TabViewItem .view>
19
19
20
20
<Label text =" Events" class =" title" />
21
21
<StackLayout class =" listitem" >
22
- <CheckBox : CheckBox text =" tap test" checked =" false" tap =" onTapTest" />
22
+ <CheckBox : CheckBox text =" tap test" tintColor = " #fff000 " checked =" false" tap =" onTapTest" />
23
23
<Label text =" {{ eventLabel }}" textWrap =" true" class =" message" />
24
24
</StackLayout >
25
25
46
46
<ListView items =" {{ uberData }}" separatorColor =" #d0d0d0" >
47
47
<ListView .itemTemplate>
48
48
<StackLayout class =" list-item" >
49
- <CheckBox : CheckBox class =" list-check" text =" {{ text }}" checked =" {{ checked }}" fillColor =" {{ color }}" tintColor =" {{ color }}" propertyChanged =" onPropertyChanged" />
49
+ <CheckBox : CheckBox class =" list-check" ios : color = " #555 " text =" {{ text }}" checked =" {{ checked }}" fillColor =" {{ color }}" tintColor =" {{ color }}" propertyChanged =" onPropertyChanged" />
50
50
</StackLayout >
51
51
</ListView .itemTemplate>
52
52
</ListView >
Original file line number Diff line number Diff line change 22
22
"typescript" : " ^1.8.10" ,
23
23
"tns-platform-declarations" : " 2.0.0"
24
24
}
25
- }
25
+ }
You can’t perform that action at this time.
0 commit comments