Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1da4cfb

Browse files
Merge pull request #1725 from NativeScript/merge-release-in-master
Merge release in master
2 parents 3c7ad92 + c49e65f commit 1da4cfb

22 files changed

+298
-87
lines changed

‎CHANGELOG.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
<a name="7.2.1"></a>
2+
## [7.2.1](https://github.com/NativeScript/nativescript-angular/compare/7.2.0...7.2.1) (2019年02月10日)
3+
4+
5+
### Bug Fixes
6+
7+
* **location-strategy:** extend support for nested primary outlets ([566896d](https://github.com/NativeScript/nativescript-angular/commit/566896d))
8+
* Router tracing does not work with webpack ([e87ef68](https://github.com/NativeScript/nativescript-angular/commit/e87ef68))
9+
10+
11+
112
<a name="7.2.0"></a>
213
# [7.2.0](https://github.com/NativeScript/nativescript-angular/compare/7.1.2...7.2.0) (2019年01月31日)
314

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<page-router-outlet></page-router-outlet>
1+
<page-router-outlettag="rootPRO"></page-router-outlet>

‎e2e/nested-router-tab-view/app/app.routing.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ const routes: Routes = [
4848
path: "home-lazy",
4949
loadChildren: "./home-lazy/home-lazy.module#HomeLazyModule",
5050
},
51+
{
52+
path: "custom-tabs",
53+
loadChildren: "./custom-tabs/custom-tabs.module#CustomTabsModule",
54+
},
5155
{
5256
path: "tabs", component: TabsComponent, children: [
5357
{ path: "players", component: PlayerComponent, outlet: "playerTab" },
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<ActionBar title="Custom Tabs Component" class="action-bar">
2+
<NavigationButton text="Root Back"></NavigationButton>
3+
4+
<StackLayout orientation="horizontal">
5+
<Button horizontalAlignment="left" android:visibility="visible" ios:visibility="collapse" text="Root Back" (tap)="onRootBack()"></Button>
6+
<Label horizontalAlignment="center" text="Custom Tabs Component"></Label>
7+
</StackLayout>
8+
</ActionBar>
9+
10+
<GridLayout rows="50,*, auto">
11+
<!-- <Button row="0" text="CanGoBack(ParentRoute)" automationText="CanGoBack(ParentRoute)" col="3" (tap)="canGoBackParentRoute()"></Button> -->
12+
<GridLayout row="1">
13+
<page-router-outlet tag="customTabsPRO"></page-router-outlet>
14+
</GridLayout>
15+
<GridLayout row="2" columns="*, *">
16+
<Button col="0" text="Players Tab" [nsRouterLink]="['../tabs/players']"></Button>
17+
<Button col="1" text="Teams Tab" [nsRouterLink]="['../tabs/teams']"></Button>
18+
</GridLayout>
19+
</GridLayout>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs";
3+
import { RouterExtensions } from "nativescript-angular/router";
4+
import { ActivatedRoute } from "@angular/router";
5+
import { confirm } from "tns-core-modules/ui/dialogs";
6+
import { Page } from 'tns-core-modules/ui/page/page';
7+
8+
@Component({
9+
moduleId: module.id,
10+
selector: 'custom-tabs',
11+
templateUrl: './custom-tabs.component.html'
12+
})
13+
export class CustomTabsComponent implements OnInit {
14+
15+
constructor(
16+
private activeRoute: ActivatedRoute,
17+
private routerExtension: RouterExtensions,
18+
private page: Page) { }
19+
20+
ngOnInit() {
21+
}
22+
23+
canGoBackParentRoute() {
24+
const canGoBackParentRoute = this.routerExtension.canGoBack({ relativeTo: this.activeRoute });
25+
const title = "CanGoBack(ParentRoute)";
26+
this.onShowDialog(title, title + ` ${canGoBackParentRoute}`);
27+
}
28+
29+
onRootBack() {
30+
this.page.frame.goBack();
31+
}
32+
33+
onShowDialog(title: string, result: string) {
34+
let options: any = {
35+
title: title,
36+
message: result,
37+
okButtonText: "Ok"
38+
}
39+
40+
confirm(options).then((result: boolean) => {
41+
console.log(result);
42+
})
43+
}
44+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2+
import { NativeScriptCommonModule } from 'nativescript-angular/common';
3+
import { NativeScriptRouterModule } from 'nativescript-angular/router';
4+
5+
import { CustomTabsComponent } from './custom-tabs.component';
6+
import { PlayerComponent } from "../player/players.component";
7+
import { PlayerDetailComponent } from "../player/player-detail.component";
8+
import { TeamsComponent } from "../team/teams.component";
9+
import { TeamDetailComponent } from "../team/team-detail.component";
10+
import { Route } from "@angular/router";
11+
import { SharedModule } from "../shared.module";
12+
13+
const routes: Route[] = [
14+
{
15+
path: 'tabs',
16+
component: CustomTabsComponent,
17+
children: [
18+
{ path: "players", component: PlayerComponent },
19+
{ path: "player/:id", component: PlayerDetailComponent },
20+
21+
{ path: "teams", component: TeamsComponent },
22+
{ path: "team/:id", component: TeamDetailComponent },
23+
]
24+
},
25+
];
26+
27+
@NgModule({
28+
declarations: [CustomTabsComponent
29+
],
30+
imports: [
31+
NativeScriptCommonModule,
32+
NativeScriptRouterModule,
33+
NativeScriptRouterModule.forChild(routes),
34+
SharedModule
35+
],
36+
schemas: [NO_ERRORS_SCHEMA]
37+
})
38+
export class CustomTabsModule { }

‎e2e/nested-router-tab-view/app/login/login.component.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</ActionBar>
44

55
<StackLayout>
6-
<!-- <Button text="Go To Home Page" [nsRouterLink]="['/home', { outlets: { playerTab: ['players'], teamTab: ['teams'] } }]"></Button> -->
76
<Button text="Go To Home Page" [nsRouterLink]="['../home', { outlets: { playerTab: ['players'], teamTab: ['teams'] } }]"></Button>
87
<Button text="Go To Lazy Home Page" [nsRouterLink]="['../home-lazy/home', { outlets: { playerTab: ['players'], teamTab: ['teams'] } }]"></Button>
8+
<Button text="Go To Lazy Custom Tabs" [nsRouterLink]="['../custom-tabs/tabs/players']"></Button>
99
</StackLayout>

‎e2e/nested-router-tab-view/app/player/player-detail.component.html‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<ActionBar title="Player Details" class="action-bar"></ActionBar>
1+
<ActionBar title="Player Details" class="action-bar">
2+
<!-- <NavigationButton visibility="hidden"></NavigationButton> -->
3+
</ActionBar>
24
<StackLayout flexDirection="column" class="page" class="m-15">
35
<Label [text]="item.id"></Label>
46
<Label [text]="item.name + ' Details'"></Label>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<ActionBar title="Player List" class="action-bar"></ActionBar>
1+
<ActionBar title="Player List" class="action-bar">
2+
<!-- <NavigationButton visibility="hidden"></NavigationButton> -->
3+
</ActionBar>
24

3-
<GridLayout>
4-
<!-- <Button text="Open Named Modal" (tap)="onModalFrame()"></Button> -->
5-
<ListView [items]="items" class="list-group">
5+
<GridLayout rows="auto,*">
6+
<ListView row="1" [items]="items" class="list-group">
67
<ng-template let-item="item">
7-
<Label [nsRouterLink]="['../player', item.id]" [text]="item.name"
8-
class="list-group-item"></Label>
8+
<Label [nsRouterLink]="['../player', item.id]" [text]="item.name" class="list-group-item"></Label>
99
</ng-template>
1010
</ListView>
1111
</GridLayout>

‎e2e/nested-router-tab-view/app/player/players.component.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component, OnInit, ViewContainerRef } from "@angular/core";
22
import { DataService, DataItem } from "../data.service";
3-
import { RouterExtensions } from "nativescript-angular/router";
43

54
import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs";
65
import { ModalRouterComponent } from "../modal/modal-router/modal-router.component";
@@ -12,7 +11,10 @@ import { ModalRouterComponent } from "../modal/modal-router/modal-router.compone
1211
export class PlayerComponent implements OnInit {
1312
items: DataItem[];
1413

15-
constructor(private modal: ModalDialogService, private itemService: DataService, private router: RouterExtensions, private vcRef: ViewContainerRef, ) { }
14+
constructor(
15+
private modal: ModalDialogService,
16+
private itemService: DataService,
17+
private vcRef: ViewContainerRef, ) { }
1618

1719
ngOnInit(): void {
1820
this.items = this.itemService.getPlayers();

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /