File tree Expand file tree Collapse file tree 3 files changed +36
-9
lines changed Expand file tree Collapse file tree 3 files changed +36
-9
lines changed Original file line number Diff line number Diff line change 4
4
</ ActionBar >
5
5
6
6
< StackLayout >
7
- < Pager [items] ="items " height ="300 " [selectedIndex] ="selectedIndex " (selectedIndexChange) ="onIndexChanged($event) "
8
- indicator ="fill " showIndicator ="true ">
9
- < ng-template let-i ="index " let-item ="item ">
10
- < GridLayout [backgroundColor] ="item.color ">
11
- < Label class ="label " [text] ="item.title "> </ Label >
12
- </ GridLayout >
13
- </ ng-template >
14
- </ Pager >
7
+ < GridLayout >
8
+ < Pager id ="pager " [items] ="items " height ="300 " [selectedIndex] ="selectedIndex " (selectedIndexChange) ="onIndexChanged($event) ">
9
+ < ng-template let-i ="index " let-item ="item ">
10
+ < GridLayout [backgroundColor] ="item.color ">
11
+ < Label class ="label " [text] ="item.title "> </ Label >
12
+ </ GridLayout >
13
+ </ ng-template >
14
+ </ Pager >
15
+ < PagerIndicator pagerViewId ="pager " type ="thin_worm " verticalAlignment ="bottom " horizontalAlignment ="center "
16
+ marginBottom ="10 " color ="#C3AEC6 " selectedColor ="#77567a " />
17
+ </ GridLayout >
15
18
< Button text ="Reset " (tap) ="resetPager() "> </ Button >
16
19
</ StackLayout >
Original file line number Diff line number Diff line change 1
1
import { NO_ERRORS_SCHEMA , NgModule } from '@angular/core' ;
2
- import { NativeScriptCommonModule , NativeScriptModule } from '@nativescript/angular' ;
2
+ import { NativeScriptCommonModule , NativeScriptModule , registerElement } from '@nativescript/angular' ;
3
3
4
4
import { PagerModule } from '@nativescript-community/ui-pager/angular' ;
5
+ import { PagerIndicator } from "@nativescript-community/ui-pager-indicator" ;
6
+ registerElement ( "PagerIndicator" , ( ) => PagerIndicator )
5
7
6
8
import { StaticPagerComponent } from './static-pager/static-pager.component' ;
7
9
import { BasicPagerComponent } from './basic-pager/basic-pager.component' ;
Original file line number Diff line number Diff line change @@ -28,6 +28,28 @@ Run the following command from the root of your project:
28
28
PagerIndicator add page control for Pager or other Paging Views.
29
29
```
30
30
31
+ ## Usage in Angular
32
+
33
+
34
+ If you are planning to use an indicator, add the following to your module:
35
+
36
+ ``` typescript
37
+ import { registerElement } from " @nativescript/angular" ;
38
+ import { PagerIndicator } from " @nativescript-community/ui-pager-indicator" ;
39
+ registerElement (" PagerIndicator" , () => PagerIndicator )
40
+ ```
41
+
42
+ Then in your template:
43
+ ``` html
44
+ <Pager id =" pager" [items] =" items"
45
+ ...
46
+ </Pager >
47
+ <PagerIndicator pagerViewId =" pager" />
48
+ ```
49
+
50
+ ### Examples
51
+ - [ Indicator Pager] ( demo-snippets/ng/indicator )
52
+ - A simple pager example using dynamic content and indicator.
31
53
32
54
## Usage in Vue
33
55
You can’t perform that action at this time.
0 commit comments