November 2018
Beginner
502 pages
10h 22m
English
Exporting code from a module allows it to be used by other modules. In order to export from a module, we use the export keyword. We can specify that an item is exported using export directly before its definition. Exports can be applied to interfaces, type aliases, classes, functions, constants, and so on.
Let's start to adjust our example code from the previous section to operate in modules rather than the global scope:
export interface Product { name: string; unitPrice: number;}
This is because Product is no longer in the global scope but OrderDetail still ...
Read now
Unlock full access