- Expert Angular
- Mathieu Nayrolles Rajesh Gunasundaram Sridhar Rao
- 68字
- 2021-07-15 17:05:33
Modules
TypeScript also supports modules As we deal with a large number of external JavaScript libraries, this modularity will really help us organize our code. Using the import statement, we can import modules as follows:
Import { inv } from "./Inventory"; var p = new inv.Product('mobile', 101);
Here, we just imported the previously created module, Inventory, created an instance of Product and assigned it to the variable p.