官术网_书友最值得收藏!

Renaming imports

Sometimes we may get a collision, with constructs being named the same. We could have this happening:

import { productService } from './module1/service'
import { productService } from './module2/service'; // name collision

This is a situation we need to resolve. We can resolve it using the as keyword, like so:

import { productService as m1_productService }
import { productService as m2_productService }

Thanks to the as keyword, the compiler now has no problem differentiating what is what.

主站蜘蛛池模板: 竹山县| 滕州市| 陇南市| 平舆县| 三亚市| 彝良县| 红河县| 宽城| 青川县| 胶南市| 浑源县| 金阳县| 上栗县| 仁怀市| 鄄城县| 白城市| 丁青县| 阿坝县| 呼和浩特市| 文水县| 镇巴县| 泰和县| 太仓市| 龙山县| 页游| 海伦市| 江陵县| 盐津县| 渭源县| 晋城| 寿宁县| 萨嘎县| 高清| 凤城市| 自治县| 右玉县| 通河县| 获嘉县| 二连浩特市| 上高县| 高平市|