Tuesday, March 26, 2019

Show the version in an Angular 7 application.

How do get the version out of package.json in an Angular 7 application into a variable in environment.ts so that I may turn around and use that variable in the greater application to display in the footer what the version number is or something?

declare var require: any;
const { version } = require('../../package.json');
export const environment = {
   numberOfTacos: 13,
   production: false,
   version: <string>version
};

No comments:

Post a Comment