In order to know the ES 2015 Module working create a code file, assume as
product.ts and export a class names
product from the file. This file then becomes a module. Because the class is exported, developer can use that class in any other module by importing it. Suppose a file called product-list.ts, and import the Product class. This file also becomes a module because of importing something.
Notice the syntax from the above image. In curly braces, one can find the name which is to be imported, in this case, Product is the name, and also define the file want to import it from. Here,
product.js is the file to import the name.
The Product class is in
product.ts. But when compiled, the TypeScript file is
transpiled into an ES 5 JavaScript file. So at runtime, one can import from the
.js file. But, the extension have not been listed anywhere.