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() {
5555
5656```
5757
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+ ```
6085
6186## Properties
6287
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ ActionBar {
1010 color : # fff ;
1111}
1212
13+ .tab-item {
14+ color : # fff ;
15+ background-color : # fff000 ;
16+ }
17+
1318
1419# wrapper {
1520 padding : 10 ;
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ ListView{
1111.list-check {
1212 font-weight : bold;
1313 font-size : 14 ;
14- color : black;
1514 margin : 2% , 0 , 2% , 2% ;
1615}
1716
Original file line number Diff line number Diff line change 33 xmlns : CheckBox =" nativescript-checkbox" loaded =" pageLoaded" >
44 <ActionBar title =" Native Checkbox" />
55
6- <TabView id =" tabViewContainer" >
6+ <TabView id =" tabViewContainer" selectedColor = " #fff " tabsBackgroundColor = " #336699 " >
77 <TabView .items>
88 <TabViewItem title =" General" class =" tab-item" >
99 <TabViewItem .view>
1919
2020 <Label text =" Events" class =" title" />
2121 <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" />
2323 <Label text =" {{ eventLabel }}" textWrap =" true" class =" message" />
2424 </StackLayout >
2525
4646 <ListView items =" {{ uberData }}" separatorColor =" #d0d0d0" >
4747 <ListView .itemTemplate>
4848 <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" />
5050 </StackLayout >
5151 </ListView .itemTemplate>
5252 </ListView >
Original file line number Diff line number Diff line change 2222 "typescript" : " ^1.8.10" ,
2323 "tns-platform-declarations" : " 2.0.0"
2424 }
25- }
25+ }
You can’t perform that action at this time.
0 commit comments