diff --git a/examples/router/README.md b/examples/router/README.md new file mode 100644 index 0000000..04446a5 --- /dev/null +++ b/examples/router/README.md @@ -0,0 +1,7 @@ +# Example "router" + +[![GitPod Logo](../../doc/run-in-gitpod.png)](https://gitpod.io/#example=router/https://github.com/eclipsesource/tabris-decorators/tree/tabris-router/examples/router) + +## Description + +Demonstrates the usage of the router API. diff --git a/examples/router/package.json b/examples/router/package.json new file mode 100644 index 0000000..3d6e2fd --- /dev/null +++ b/examples/router/package.json @@ -0,0 +1,21 @@ +{ + "name": "router", + "version": "3.3.0", + "dependencies": { + "reflect-metadata": "^0.1.13" + }, + "optionalDependencies": { + "tabris": "^3.3.0", + "tabris-decorators": "3.3.0" + }, + "devDependencies": { + "typescript": "3.3.x" + }, + "main": "dist/app.js", + "scripts": { + "start": "tabris serve -w -a", + "build": "tsc -p .", + "watch": "tsc -p . -w --preserveWatchOutput --inlineSourceMap", + "gitpod": "tabris serve -a -w --no-intro --port 8080 --external $(gp url 8080):443" + } +} diff --git a/examples/router/src/app.tsx b/examples/router/src/app.tsx new file mode 100644 index 0000000..753a937 --- /dev/null +++ b/examples/router/src/app.tsx @@ -0,0 +1,64 @@ +import {NavigationView, contentView, Button, TextView, TextInput, Stack, Page, Properties} from 'tabris'; +import {Router, Route, injectable, create, resolve, property, component } from 'tabris-decorators'; + +const navigationView = new NavigationView({ + layoutData: 'stretch' +}).appendTo(contentView); + +class MyPage1 extends Page { + constructor(properties?: Properties) { + super(properties); + this.append( + + +