Skip to content

Commit

Permalink
Add version number in app
Browse files Browse the repository at this point in the history
Related to #80
  • Loading branch information
sebastienbarbier committed Jun 20, 2023
1 parent 38e8cab commit 5fbd379
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/legal/legal.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h2>Hosting</h2>

<h2>Licence</h2>
<p>Content is licensed under a <a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International license</a>.</p>
<p>Website is licensed under a <a href="https://opensource.org/licenses/MIT">MIT licence</a>. Source code is available <a href="https://github.com/sebastienbarbier/sebastienbarbier.com">on github</a>.</p>
<p>Website is licensed under a <a href="https://opensource.org/licenses/MIT">MIT licence</a>. Source code (v{{ version }}) is available <a href="https://github.com/sebastienbarbier/sebastienbarbier.com">on github</a>.</p>

</div>
<route-footer></route-footer>
Expand Down
3 changes: 3 additions & 0 deletions src/app/legal/legal.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { environment } from '../../environments/environment';

@Component({
selector: 'app-legal',
Expand All @@ -7,6 +8,8 @@ import { Component, OnInit } from '@angular/core';
})
export class LegalComponent implements OnInit {

version: string = environment.version;

constructor() { }

ngOnInit() {
Expand Down
5 changes: 4 additions & 1 deletion src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const packageJson = require('../../package.json');

export const environment = {
production: true
production: true,
version: packageJson.version,
};
5 changes: 4 additions & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.

const packageJson = require('../../package.json');

export const environment = {
production: false
production: false,
version: packageJson.version,
};
3 changes: 2 additions & 1 deletion src/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"types": []
"module": "esNext",
"types": ["node"],
},
"include": [
"**/*.ts"
Expand Down
2 changes: 1 addition & 1 deletion src/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"baseUrl": "./",
// Set the module format to "commonjs":
"module": "commonjs",
"types": []
"types": ["node"]
},
"exclude": [
"test.ts",
Expand Down

0 comments on commit 5fbd379

Please sign in to comment.