I wanted to create a global variable which is of type boolean, I wanted to utilize the same variable in multiple components ( Without using Service ).To be precise I also wanted to capture the variable value from any component if it is changed in other components.
try declaring the variable in environment.ts file
There are few options to do it.
environment.ts
. Do note that you need to replicate it across envionment.prod.ts
and other environment files if you may have.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.