简体   繁体   中英

How do you access a variable in a Typescript file into a Javascript file?

For instance, I want to get the feature_on value as a result of an if/else statement in a typescript file in another javascript file.

var feature_on = false;
if(SOME_SPECIAL_STATEMENT === true)
{
   feature_on = true;
}

For instance, I want to get the feature_on value as a result of an if/else statement in a typescript file in another javascript file

Compile TypeScript to get a JS. Then use the JS file just like you would already know / or can search for 🌹

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM