November 2019
Beginner
804 pages
20h 1m
English
It is also possible to import symbols from a module by giving a name instead of a relative path, as we saw in the Angular example before (import { ... } from "@angular/core"), and also in Chapter 4, Leveraging Generics and Enums to Build a Media Management Web Application, with localForage.
How does TypeScript know what to load when a module name is used? This question is important and certainly not trivial, so let's take some time to go through this. Understanding this process will allow you to avoid seeing module resolution as some kind of magical process.
If you import import {foo} from "bar" and if the node strategy is used by the compiler, then TypeScript will try to locate the bar module in folders called ...
Read now
Unlock full access