ng add @ngx-env/builder
.env NG_APP_ENABLE_ANALYTICS=false
NG_APP_VERSION=$npm_package_version
NG_APP_COMMIT=$GITHUB_SHA
@Component({
selector: "app-footer",
})
export class FooterComponent {
version = process.env.NG_APP_VERSION;
branch = process.env.NG_APP_BRANCH_NAME;
commit = process.env.NG_APP_COMMIT;
analyticsFlag = process.env.NG_APP_ENABLE_ANALYTICS;
}
npm start
NG_APP_BRANCH_NAME=$GITHUB_HEAD_REF ng test
NG_APP_BRANCH_NAME=`git branch --show-current` npm run build