diff --git a/angular.json b/angular.json
index e52d019..eae0de1 100644
--- a/angular.json
+++ b/angular.json
@@ -8,7 +8,11 @@
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
- "schematics": {},
+ "schematics": {
+ "@schematics/angular:component": {
+ "styleext": "scss"
+ }
+ },
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
diff --git a/src/app/app.component.html b/src/app/app.component.html
index 4c88d65..c96ed95 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -14,4 +14,5 @@
+
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 3734a54..7ef864d 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -5,16 +5,22 @@ import {ConverterRegistryService} from './converterregistry.service';
import {InputComponentManagerService} from './inputcomponentmanager.service';
import {NativeLibraryWrapperService} from './nativelibrarywrapper.service';
import {FormsModule} from '@angular/forms';
+import {VersionComponent} from './version/version.component';
@NgModule({
declarations: [
- AppComponent
+ AppComponent,
+ VersionComponent
],
imports: [
BrowserModule,
FormsModule
],
- providers: [ConverterRegistryService, InputComponentManagerService, NativeLibraryWrapperService],
+ providers: [
+ ConverterRegistryService,
+ InputComponentManagerService,
+ NativeLibraryWrapperService
+ ],
bootstrap: [AppComponent]
})
export class AppModule {
diff --git a/src/app/version/version.component.html b/src/app/version/version.component.html
new file mode 100644
index 0000000..566bf3c
--- /dev/null
+++ b/src/app/version/version.component.html
@@ -0,0 +1 @@
+Version: {{VERSION}}
diff --git a/src/app/version/version.component.scss b/src/app/version/version.component.scss
new file mode 100644
index 0000000..46b3ceb
--- /dev/null
+++ b/src/app/version/version.component.scss
@@ -0,0 +1,10 @@
+div {
+ font-size: smaller;
+ color: gray;
+ display: block;
+ text-align: right;
+ margin-right: 2em;
+ &.dev {
+ color: red;
+ }
+}
diff --git a/src/app/version/version.component.spec.ts b/src/app/version/version.component.spec.ts
new file mode 100644
index 0000000..fcd0475
--- /dev/null
+++ b/src/app/version/version.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { VersionComponent } from './version.component';
+
+describe('VersionComponent', () => {
+ let component: VersionComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ VersionComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(VersionComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/version/version.component.ts b/src/app/version/version.component.ts
new file mode 100644
index 0000000..53d2c1a
--- /dev/null
+++ b/src/app/version/version.component.ts
@@ -0,0 +1,15 @@
+import {Component} from '@angular/core';
+import {environment} from '../../environments/environment';
+
+@Component({
+ selector: 'app-version',
+ templateUrl: './version.component.html',
+ styleUrls: ['./version.component.scss']
+})
+export class VersionComponent {
+ public readonly PROD: boolean = environment.production;
+ public readonly VERSION: string = environment.appVersion + (this.PROD ? '' : ' (development build)');
+
+ constructor() {
+ }
+}
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index 3612073..d8516dc 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -1,3 +1,4 @@
export const environment = {
- production: true
+ production: true,
+ appVersion: require('../../package.json').version
};
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 600fdaf..70b66dd 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -3,7 +3,8 @@
// The list of file replacements can be found in `angular.json`.
export const environment = {
- production: false
+ production: false,
+ appVersion: require('../../package.json').version
};
/*
diff --git a/src/tsconfig.app.json b/src/tsconfig.app.json
index 190fd30..c27166e 100644
--- a/src/tsconfig.app.json
+++ b/src/tsconfig.app.json
@@ -2,7 +2,9 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
- "types": []
+ "types": [
+ "node"
+ ]
},
"exclude": [
"test.ts",