Skip to content

Commit 847e45d

Browse files
committed
rename to typescript files
1 parent 33529ba commit 847e45d

12 files changed

+104
-9
lines changed

.editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ indent_size = 2
1717
indent_style = space
1818
indent_size = 2
1919

20+
[*.ts]
21+
indent_style = space
22+
indent_size = 2
23+
2024
[*.{css,scss}]
2125
indent_style = space
2226
indent_size = 2

.eslintrc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "airbnb/base",
3+
4+
"env": {
5+
"browser": true,
6+
"es6": true,
7+
"node": true
8+
},
9+
10+
"rules": {
11+
"quotes": [2, "double", "avoid-escape"],
12+
"indent": [2, 2],
13+
"func-names": 0,
14+
"no-use-before-define": [2, "nofunc"],
15+
"prefer-arrow-callback": 0
16+
}
17+
}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ log.txt
1616
coverage/
1717
dist/
1818
node_modules/
19+
platforms/
20+
plugins/
1921
tmp/
2022
temp/
2123
www/build/

app/app.js app/app.ts

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<ion-navbar *navbar>
2+
<ion-title>Edit Geofence</ion-title>
3+
</ion-navbar>
4+
5+
<ion-content class="geofence-details-page">
6+
<ion-list>
7+
<ion-item>
8+
<ion-label stacked>Notification Text</ion-label>
9+
<ion-input [(ngModel)]="geofence.notification.text" type="text" placeholder="Example: Buy a milk"></ion-input>
10+
</ion-item>
11+
<ion-item>
12+
<ion-label stacked>Notify When You?</ion-label>
13+
<ion-select [(ngModel)]="transitionType" multiple="true">
14+
<ion-option value="1">Enter Region</ion-option>
15+
<ion-option value="2">Exit Region</ion-option>
16+
<ion-option value="3">Both</ion-option>
17+
</ion-select>
18+
</ion-item>
19+
<ion-item>
20+
<div>
21+
<ion-label stacked>on</ion-label>
22+
<ion-content>
23+
on
24+
<input type="range" name="volume" min="50" max="5000">
25+
1000m
26+
</ion-content>
27+
</div>
28+
</ion-item>
29+
</ion-list>
30+
</ion-content>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.geofence-list-page {
2+
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Page, NavController, NavParams } from "ionic/ionic";
2+
3+
@Page({
4+
templateUrl: "build/pages/geofence-details/geofence-details.html"
5+
})
6+
export class GeofenceDetailsPage {
7+
constructor(nav: NavController, navParams: NavParams) {
8+
this.nav = nav;
9+
this.geofence = navParams.get("geofence");
10+
}
11+
12+
get transitionType() {
13+
return this.geofence.transitionType.toString();
14+
}
15+
16+
set transitionType(value) {
17+
this.geofence.transitionType = parseInt(value, 10);
18+
}
19+
}

app/pages/geofence-list/geofence-list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<ion-title>Ionic 2 Geofence Example</ion-title>
33
</ion-navbar>
44

5-
<ion-content padding class="geofence-list-page">
5+
<ion-content class="geofence-list-page">
66
<ion-list>
77
<ion-item *ngFor="#geofence of geofences" (click)="itemTapped($event, geofence)">
88
<p>{{geofence.notification.text}}</p>

app/pages/geofence-list/geofence-list.js app/pages/geofence-list/geofence-list.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { Page, NavController } from "ionic/ionic";
2+
import { GeofenceDetailsPage } from "../geofence-details/geofence-details";
23

34
const FIXTURES = [
45
{ id: 1, latitude: 50.3021079, longitude: 18.6771861, radius: 3000, transitionType: 1, notification: { text: "Gliwice Train Station"} },
56
{ id: 2, latitude: 50.4728049, longitude: 19.0736874, radius: 3000, transitionType: 1, notification: { text: "Pyrzowice Airport"} },
67
{ id: 3, latitude: 50.0671974, longitude: 19.945232, radius: 3000, transitionType: 1, notification: { text: "Cracow Main Station"} },
78
{ id: 4, latitude: 52.2287803, longitude: 21.001124, radius: 3000, transitionType: 1, notification: { text: "Warsaw Main Station"} },
8-
{ id: 5, latitude: 40.7257093, longitude: -74.0032786, radius: 4000, transitionType: 1, notification: { text: "New York - SOHO"} },
9-
{ id: 6, latitude: 34.0033907, longitude: -118.5069657, radius: 3000, transitionType: 1, notification: { text: "LA - Santa Monica State Beach"} },
9+
{ id: 5, latitude: 40.7257093, longitude: -74.0032786, radius: 4000, transitionType: 3, notification: { text: "New York - SOHO"} },
10+
{ id: 6, latitude: 34.0033907, longitude: -118.5069657, radius: 3000, transitionType: 2, notification: { text: "LA - Santa Monica State Beach"} },
1011
{ id: 7, latitude: 25.8938595, longitude: -80.1330216, radius: 500, transitionType: 1, notification: { text: "Dexter's Apartment - Miami Bay Harbour" }
1112
];
1213

@@ -21,6 +22,8 @@ export class GeofenceListPage {
2122
}
2223

2324
itemTapped(event, geofence) {
24-
25+
this.nav.push(GeofenceDetailsPage, {
26+
geofence
27+
})
2528
}
2629
}

app/theme/app.core.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
// By default each design mode includes these shared imports.
88
// App Shared Sass variables belong in app.variables.scss.
99

10-
@import "../pages/main/main";
10+
@import "../pages/geofence-list/geofence-list";
11+
@import "../pages/geofence-details/geofence-details";

package.json

+18-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,25 @@
1111
},
1212
"devDependencies": {
1313
"awesome-typescript-loader": "0.15.10",
14+
"cordova": "^6.0.0",
15+
"eslint": "^1.10.3",
16+
"eslint-config-airbnb": "^5.0.0",
17+
"ionic": "^2.0.0-beta.17",
1418
"strip-sourcemap-loader": "0.0.1",
15-
"typescript": "1.7.5"
19+
"typescript": "1.7.5",
20+
"typescript-eslint-parser": "0.1.0-alpha-1"
1621
},
1722
"name": "ionic2-geofence",
18-
"description": "ionic2-geofence: An Ionic project"
23+
"description": "ionic2-geofence: An Ionic project",
24+
"cordovaPlugins": [
25+
"cordova-plugin-device",
26+
"cordova-plugin-console",
27+
"cordova-plugin-whitelist",
28+
"cordova-plugin-splashscreen",
29+
"cordova-plugin-statusbar",
30+
"ionic-plugin-keyboard"
31+
],
32+
"cordovaPlatforms": [
33+
"android"
34+
]
1935
}

webpack.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = {
1717
module: {
1818
loaders: [
1919
{
20-
test: /\.js$/,
20+
test: /\.ts$/,
2121
loader: 'awesome-typescript',
2222
query: {
2323
doTypeCheck: false,
@@ -48,6 +48,6 @@ module.exports = {
4848
'ionic': 'ionic-framework',
4949
'web-animations.min': path.normalize('ionic-framework/js/web-animations.min')
5050
},
51-
extensions: ['', '.js']
51+
extensions: ['', '.js', '.ts']
5252
}
5353
};

0 commit comments

Comments
 (0)