Angular中修改第三方组件的样式
::ng-deep img
width 100%
height 100%
border 1px solid red
请求本地json文件数据
login.component.ts
getVirtualFactoryList() {
this.http.doGet('assets/mock/x.json').subscribe((data: any) => {
this.options = data.result;
console.log(data);
});
}
http.server.ts
public api = 'http://localhost:4200/';
constructor(public http: HttpClient) {}
// get请求
doGet(url: any, params?: any) {
return new Observable(observer => {
this.http.get(this.api + url).subscribe(response => {
observer.next(response);
});
});
}