Aliases can be specified in TypeScript’s import

Aliases can be specified in TypeScript’s import

You can use as in the TypeScript import statement for aliases.

import { hoge as HOGE } from '~~'

You can use an alias to work around it if it is the same class in different ts files or something.

I noticed this when I accidentally bumped into a class defined in the lib.dom.d.ts file in Angular.

コメント

Discover more from 株式会社CONFRAGE ITソリューション事業部

Subscribe now to keep reading and get access to the full archive.

Continue reading

Copied title and URL