[Angular] Omit relative path by set up in tsconfig.json
For example, inside you component you want to import a file from two up directory:
import store from '../../store'
This becomes a little bit problematic because the component can be really nested.
To solve this problem, we can define "paths" in tsconfig.json:
{
...
"compilerOptions": {
"baseUrl": ".",
"paths": {
"store": ["src/store.ts"]
},
...
"target": "es5"
}
}
Now for each component, we can just use:
import store from 'store'
[Angular] Omit relative path by set up in tsconfig.json的更多相关文章
- RPO(Relative Path Overwrite)
Conception(Relative vs Absolute) Abosolute Path: "/etc/hosts"(in Linux), "C:\Windows\ ...
- How to put a relative path for a DLL statically loaded?
How to put a relative path for a DLL statically loaded? I have a DLL made in Delphi 7/Windows XP tha ...
- Security Report: Stop using relative path to import CSS files
Detecting and exploiting path-relative stylesheet import (PRSSI) vulnerabilities Early last year G ...
- Hive报错 Failed with exception java.io.IOException:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:user.name%7D
报错信息如下 Failed with exception java.io.IOException:java.lang.IllegalArgumentException: java.net.URISyn ...
- hive启动时报错 java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D at org.apache.hadoop.fs.Path.initialize
错误提示信息如下 错误信息如下 [root@node1 bin]# ./hive Logging initialized -bin/lib/hive-common-.jar!/hive-log4j.p ...
- c# Relative Path convert to Absolute Path
Reference: http://stackoverflow.com/questions/4796254/relative-path-to-absolute-path-in-c http://sta ...
- firefox ie 比较 relative path
relative path 对于firefox ie 来说是不同的 在ie中 <base href="/">起基础url作用 此时 <a href="& ...
- 规范 : angular ui router path & params
在seo文章中提到url的path 必须是 why-us,而不是whyUS 所以定了规范,所有的path 必须why-us path ?后尾的是用来filter的,所以可以WhyUs 如果是不需要给s ...
- FAILED java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI:hdfs:192.*
运行的参数配置 hdfs:192.168.58.180/cf/userItem.txt 应该写成 hdfs://192.*
随机推荐
- Android基础新手教程——1.2.1 使用Eclipse + ADT + SDK开发Android APP
Android基础新手教程--1.2.1 使用Eclipse + ADT + SDK开发Android APP 标签(空格分隔): Android基础新手教程 1.前言 这里我们有两条路能够选,直接使 ...
- 压缩感知——SP(subspace pursuit)重构算法前言翻译
压缩感知是一种採样方法,它和变换编码类似,后者被广泛用于涉及到大规模数据採样的现代通信系统中.变换编码将高维空间中的输入信号.转换成很低的低维空间中的信号.变换编码器的样例有著名的小波变换和普遍存在的 ...
- AutoLayout具体解释+手把手实战
首先说一下这篇博客尽管是标记为原创,可是事实并不是本人亲自写出来的.知识点和样例本人花了一天各处查找和整理终于决定写一个汇总的具体解释,解去各位朋友到处盲目查找的必要,由于不是转载某一个人的内容.故此 ...
- js---15深拷贝浅拷贝 原型链
//&&得到的结果不是布尔类型,如果前面都是 true就执行最后一个,并返回最后一个表达式的值,前面有一个为false,后面不执行,返回前面表达式的值 var a = 3; var b ...
- RTSP、HTTP、HTTPS、SDP四种协议详解
我们将主要讲解RTSP,HTTP,HTTPS, SDP四种协议. 一:RTSP协议简介 实时流协议RTSP是一个应用层协议,用于控制具有实时特性的数据(例如多媒体流)的传送. RTSP协议一般与RT ...
- freeMark
1. 什么是freemark Freemaker是一个”模板引擎”,也可以说是一个基于模板技术的生成文本输出的一个通用工具 2.一般的用途: l 能用来生成任意格式的文本:HTML,XML ...
- HDU 4007 Dave(离散化)
Dave Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submis ...
- Es5正则
##JSON(ES5) 前端后台都能识别的数据.(一种数据储存格式) XNL在JSON出来前 JSON不支持 undefinde和函数. 示列:let = '[{"useername&qu ...
- Spring3 整合MyBatis3 配置多数据源 动态选择SqlSessionFactory(转)
1. Spring整合MyBatis切换SqlSessionFactory有两种方法,第一. 继承SqlSessionDaoSupport,重写获取SqlSessionFactory的方法.第二.继承 ...
- IntelliJ IDEA 中如何配置多个jdk版本即(1.7和1.8两个jdk都可用)
IntelliJ IDEA使用教程 (总目录篇) 有时候需要看Java源码,但是 Java 1.7 和 Java 1.8的差别的关系,有时候你想查看不同jdk版本的Java源码. 或者你的项目需要测试 ...