Skip to content

Commit 4fec8bc

Browse files
committed
add version label
1 parent 8ae4259 commit 4fec8bc

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

src/app/pages/menu/menu.page.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
<ion-icon slot="start" name="information-circle"></ion-icon>
2626
<ion-label>About</ion-label>
2727
</ion-item>
28+
<ion-item lines="none">
29+
</ion-item>
2830
</ion-list>
2931
</div>
32+
<p class="version-label">v.{{version}}</p>
33+
3034
</ion-content>

src/app/pages/menu/menu.page.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.version-label {
2+
font-size: 12px;
3+
color: gray;
4+
text-align: center;
5+
margin-top: 16px;
6+
}

src/app/pages/menu/menu.page.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, OnInit } from '@angular/core';
2+
import packageJson from '../../../../package.json';
23

34
@Component({
45
selector: 'app-menu',
@@ -8,9 +9,18 @@ import { Component, OnInit } from '@angular/core';
89
})
910
export class MenuPage implements OnInit {
1011

12+
version: string = '0.0.0';
13+
1114
constructor() { }
1215

1316
ngOnInit() {
17+
this.version = packageJson.version;
18+
19+
}
20+
21+
async getVersion() {
22+
// get version from package.json
1423
}
24+
1525

1626
}

tsconfig.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@
1919
"target": "es2022",
2020
"module": "es2020",
2121
"lib": [
22-
"es2022",
22+
"es2022",
2323
"dom"
2424
],
2525
"useDefineForClassFields": false,
26-
"strictNullChecks": false
26+
"strictNullChecks": false,
27+
"resolveJsonModule": true,
28+
"allowSyntheticDefaultImports": true
2729
},
2830
"angularCompilerOptions": {
2931
"enableI18nLegacyMessageIdFormat": false,
3032
"strictInjectionParameters": true,
3133
"strictInputAccessModifiers": true,
3234
"strictTemplates": true
3335
}
34-
}
36+
}

0 commit comments

Comments
 (0)