1
0
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:
Denis Strigo
2018-08-29 19:11:11 +03:00
parent 1e75a1ecc8
commit b82f800816
5 changed files with 24 additions and 4 deletions

View File

@@ -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": {

View File

@@ -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]) {

View File

@@ -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(),

View File

@@ -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
View File

@@ -0,0 +1,8 @@
{
"/api": {
"target": "http://localhost:3000",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
}
}