Display the application version #4
10 changed files with 72 additions and 6 deletions
|
@ -8,7 +8,11 @@
|
||||||
"sourceRoot": "src",
|
"sourceRoot": "src",
|
||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
"schematics": {},
|
"schematics": {
|
||||||
|
"@schematics/angular:component": {
|
||||||
|
"styleext": "scss"
|
||||||
|
}
|
||||||
|
},
|
||||||
"architect": {
|
"architect": {
|
||||||
"build": {
|
"build": {
|
||||||
"builder": "@angular-devkit/build-angular:browser",
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
|
|
|
@ -14,4 +14,5 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="errormessage" *ngIf="step.error" [innerHTML]="step.message"></div>
|
<div class="errormessage" *ngIf="step.error" [innerHTML]="step.message"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<app-version></app-version>
|
||||||
<!--<router-outlet></router-outlet>-->
|
<!--<router-outlet></router-outlet>-->
|
||||||
|
|
|
@ -5,16 +5,22 @@ import {ConverterRegistryService} from './converterregistry.service';
|
||||||
import {InputComponentManagerService} from './inputcomponentmanager.service';
|
import {InputComponentManagerService} from './inputcomponentmanager.service';
|
||||||
import {NativeLibraryWrapperService} from './nativelibrarywrapper.service';
|
import {NativeLibraryWrapperService} from './nativelibrarywrapper.service';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
|
import {VersionComponent} from './version/version.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent
|
AppComponent,
|
||||||
|
VersionComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
FormsModule
|
FormsModule
|
||||||
],
|
],
|
||||||
providers: [ConverterRegistryService, InputComponentManagerService, NativeLibraryWrapperService],
|
providers: [
|
||||||
|
ConverterRegistryService,
|
||||||
|
InputComponentManagerService,
|
||||||
|
NativeLibraryWrapperService
|
||||||
|
],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
})
|
})
|
||||||
export class AppModule {
|
export class AppModule {
|
||||||
|
|
1
src/app/version/version.component.html
Normal file
1
src/app/version/version.component.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<div [ngClass]="{dev: !PROD}">Version: {{VERSION}}</div>
|
10
src/app/version/version.component.scss
Normal file
10
src/app/version/version.component.scss
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
div {
|
||||||
|
font-size: smaller;
|
||||||
|
color: gray;
|
||||||
|
display: block;
|
||||||
|
text-align: right;
|
||||||
|
margin-right: 2em;
|
||||||
|
&.dev {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
}
|
25
src/app/version/version.component.spec.ts
Normal file
25
src/app/version/version.component.spec.ts
Normal file
|
@ -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<VersionComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ VersionComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(VersionComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
15
src/app/version/version.component.ts
Normal file
15
src/app/version/version.component.ts
Normal file
|
@ -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() {
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: true
|
production: true,
|
||||||
|
appVersion: require('../../package.json').version
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
// The list of file replacements can be found in `angular.json`.
|
// The list of file replacements can be found in `angular.json`.
|
||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false
|
production: false,
|
||||||
|
appVersion: require('../../package.json').version
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
"extends": "../tsconfig.json",
|
"extends": "../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../out-tsc/app",
|
"outDir": "../out-tsc/app",
|
||||||
"types": []
|
"types": [
|
||||||
|
"node"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"test.ts",
|
"test.ts",
|
||||||
|
|
Loading…
Reference in a new issue