0
絶対パス(つまり別のモジュール)を使用してコンポーネントテンプレート/スタイルを読み込む方法は?絶対パスを使用したテンプレート/スタイルのロード
@Component({
selector: 'a-component',
templateUrl: 'shared-module/components/another-shared-component/component.html',
styleUrls: ['shared-module/components/another-shared-component/component.scss']
})
は私が/
、~/
を使用してトライを持っているだけで、モジュール名で始まるが、どれも働きました。
'../'動作しますが、それは意志ますコンポーネントフォルダに到達するには長い道のりでなければならないので、私は絶対的なアプローチを探していたのです。 – Ayman
多分[このように質問](https://stackoverflow.com/questions/34925992/how-to-avoid-imports-with-very-long-relative-paths-in-angular-2)は役に立ちます – Milo
これはのためですTypeScriptモジュールシステム。 Angularはこれを考慮していないようです(ただし、そうしても意味があります)。 – Ayman