我正在使用angular 5.我的模块我正在使用单张1.2.0。角。如何从node_modules导入css
在leaflet.css我有图片的麻烦,例如,一些CSS行:
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(/assets/images/leaflet/layers-2x.png);
background-size: 26px 26px;
}
/* Default icon URLs */
.leaflet-default-icon-path {
background-image: url(/assets/images/leaflet/marker-icon.png);
}
所以,我需要访问leaflet.css其相对的路线,我的尝试:
@Component({
selector: 'myComponent',
template:`<div id="myId" class="myClass"></div>`,
styleUrls: ['./myComponent.component.scss','/../../../../node_modules/leaflet/dist/leaflet.css'],
})
的文件夹结构:
--project_folder
--node_modules
--leaflet
--dist
--leaflet.css
--src
--app
--myComponentParent
--myComponent
--myComponent.component.ts
--myComponent.component.scss
--myComponent.component.html
可以参考我夹了SRC的?我该怎么做?