File tree 1 file changed +15
-3
lines changed
apps/nativescript-starter-angular/src/app/item
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
- import { Component , OnInit } from '@angular/core'
1
+ import { Component , OnInit , inject } from '@angular/core'
2
+ import { Page } from '@nativescript/core'
2
3
3
4
import { Item } from './item'
4
5
import { ItemService } from './item.service'
@@ -8,9 +9,20 @@ import { ItemService } from './item.service'
8
9
templateUrl : './items.component.html' ,
9
10
} )
10
11
export class ItemsComponent implements OnInit {
11
- items : Array < Item >
12
+ page = inject ( Page ) ;
13
+ itemService = inject ( ItemService ) ;
14
+ items : Array < Item > ;
12
15
13
- constructor ( private itemService : ItemService ) { }
16
+ constructor ( ) {
17
+ // Setup large titles on iOS
18
+ this . page . on ( 'loaded' , ( args ) => {
19
+ if ( __IOS__ ) {
20
+ const navigationController : UINavigationController =
21
+ this . page . frame . ios . controller ;
22
+ navigationController . navigationBar . prefersLargeTitles = true ;
23
+ }
24
+ } ) ;
25
+ }
14
26
15
27
ngOnInit ( ) : void {
16
28
this . items = this . itemService . getItems ( )
You can’t perform that action at this time.
0 commit comments