Skip to content

Commit f6c7036

Browse files
author
vakrilov
committed
demo for testing livesync
1 parent adf33be commit f6c7036

File tree

7 files changed

+82
-0
lines changed

7 files changed

+82
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.title {
2+
font-size: 30;
3+
margin: 16;
4+
color: darkblue;
5+
}
6+
7+
button {
8+
horizontal-align: center;
9+
margin: 10;
10+
}
11+
12+
stack-layout {
13+
background-color: lightgreen;
14+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Component } from "@angular/core";
2+
import { ROUTER_DIRECTIVES } from '@angular/router';
3+
import { NS_ROUTER_DIRECTIVES} from "nativescript-angular/router"
4+
5+
@Component({
6+
selector: "first",
7+
directives: [ROUTER_DIRECTIVES, NS_ROUTER_DIRECTIVES],
8+
styleUrls: ["examples/livesync-test/first/first.component.css"],
9+
templateUrl: "examples/livesync-test/first/first.component.xml"
10+
})
11+
export class FirstComponent {
12+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<StackLayout>
2+
<Label text="First Page" class="title"></Label>
3+
<Button text="Go to second" nsRouterLink="second"></Button>
4+
</StackLayout>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Component } from "@angular/core";
2+
import { RouterConfig } from '@angular/router';
3+
import { NS_ROUTER_DIRECTIVES, nsProvideRouter} from "nativescript-angular/router"
4+
5+
import {FirstComponent} from "./first/first.component";
6+
import {SecondComponent} from "./second/second.component";
7+
8+
@Component({
9+
selector: 'livesync-app-test',
10+
directives: [NS_ROUTER_DIRECTIVES],
11+
template: `<page-router-outlet></page-router-outlet>`
12+
})
13+
export class LivesyncApp { }
14+
15+
const routes: RouterConfig = [
16+
{ path: "", component: FirstComponent },
17+
{ path: "second", component: SecondComponent },
18+
];
19+
20+
export const LivesyncTestRouterProviders = [
21+
nsProvideRouter(routes, { enableTracing: false })
22+
];
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.title {
2+
font-size: 30;
3+
margin: 16;
4+
color: darkgreen;
5+
}
6+
7+
button {
8+
horizontal-align: center;
9+
margin: 10;
10+
}
11+
12+
stack-layout {
13+
background-color: lightblue;
14+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Component } from "@angular/core";
2+
import { ROUTER_DIRECTIVES } from '@angular/router';
3+
import { NS_ROUTER_DIRECTIVES} from "nativescript-angular/router"
4+
5+
@Component({
6+
selector: "second",
7+
directives: [ROUTER_DIRECTIVES, NS_ROUTER_DIRECTIVES],
8+
styleUrls: ["examples/livesync-test/second/second.component.css"],
9+
templateUrl: "examples/livesync-test/second/second.component.xml"
10+
})
11+
export class SecondComponent {
12+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<StackLayout>
2+
<Label text="Second Page" class="title"></Label>
3+
<Button text="Go to first" nsRouterLink=""></Button>
4+
</StackLayout>

0 commit comments

Comments
 (0)