How do I display the app version in angular application? the version should be taken from package.json
file
{
\"name\": \"angular-app\",
\"v
Trying DyslexicDcuk's answer resulted in cannot find name require
Then, reading 'Optional Module Loading and Other Advanced Loading Scenarios' section in https://www.typescriptlang.org/docs/handbook/modules.html helped me solve this. (Mentioned by Gary here https://stackoverflow.com/a/41767479/7047595)
Use the below declaration to require package.json.
declare function require(moduleName: string): any;
const {version : appVersion} = require('path-to-package.json');