mirror of
https://github.com/akveo/eva-icons.git
synced 2025-09-08 21:20:47 +02:00
feat: add proxy config
This commit is contained in:
@@ -53,7 +53,8 @@
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "eva-icons:build"
|
||||
"browserTarget": "eva-icons:build",
|
||||
"proxyConfig": "src/proxy.conf.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
|
@@ -1,4 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
// todo: uncomment when api will be implemented
|
||||
// import { HttpClient } from '@angular/common/http';
|
||||
|
||||
class IconsFormat {
|
||||
png?: boolean;
|
||||
@@ -33,6 +35,8 @@ export class DownloadIconsComponent {
|
||||
png: '64',
|
||||
};
|
||||
|
||||
/*constructor(private http: HttpClient) {}*/
|
||||
|
||||
selectedSizes: IconsSize = {
|
||||
png: this.defaultIconsSizes[this.png],
|
||||
};
|
||||
@@ -66,6 +70,13 @@ export class DownloadIconsComponent {
|
||||
|
||||
downloadIcons() {
|
||||
// todo: uncomment when api will be implemented
|
||||
/* this.http.get(
|
||||
'/api',
|
||||
{
|
||||
responseType: 'text',
|
||||
})
|
||||
.subscribe((response) => {
|
||||
});*/
|
||||
/* const icons: Icon[] = Object.keys(this.selectedFormats)
|
||||
.reduce((result, iconFormat) => {
|
||||
if (this.selectedFormats[iconFormat]) {
|
||||
|
@@ -2,6 +2,7 @@ import { APP_BASE_HREF } from '@angular/common';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
|
||||
import { EvaThemeModule } from './@theme/theme.module';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
@@ -18,6 +19,7 @@ import { PagesModule } from './pages/pages.module';
|
||||
BrowserAnimationsModule,
|
||||
AppRoutingModule,
|
||||
PagesModule,
|
||||
HttpClientModule,
|
||||
|
||||
EvaThemeModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
|
@@ -76,7 +76,7 @@ export class OutlineComponent implements AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
clickIcon(icon) {
|
||||
const modalRef = this.modalService.show(
|
||||
this.modalService.show(
|
||||
DownloadIconComponent,
|
||||
{
|
||||
hasBackdrop: true,
|
||||
@@ -84,8 +84,6 @@ export class OutlineComponent implements AfterViewInit, OnDestroy {
|
||||
closeOnBackdropClick: true,
|
||||
},
|
||||
);
|
||||
|
||||
modalRef.content.selectedIcon = icon;
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
8
src/proxy.conf.json
Normal file
8
src/proxy.conf.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"/api": {
|
||||
"target": "http://localhost:3000",
|
||||
"secure": false,
|
||||
"changeOrigin": true,
|
||||
"logLevel": "debug"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user