I am an angular developer. and as a requirement of company, I need to add version into my angular project's one page(component).
for manage version. I did make one variable called "Version" in environment/environment.ts and other environment's files.
Now current flow of version is like this :
But Now I want to automate that version variable into environment files. while I run command with appropriate configuration, It should automatic increase version into appropriate file and then should made a new build.
I started to find this kind of scenario and solution on google before a week ago, but still not found any solution, how to achieve that.
If anyone have any idea about environment's variable change while build. then Please share it with me. It will really helpful for me.
Yes it's possible. Instead of using the values directly on environment
files , you can use package.json
file. Which will serve the purpose of increment the value automatically.
Check the link for step by step guide.
https://medium.com/@tolvaly.zs/how-to-version-number-angular-6-applications-4436c03a3bd3