diff --git a/angular.json b/angular.json index 3209f13..5bd92d4 100644 --- a/angular.json +++ b/angular.json @@ -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": { diff --git a/src/app/@theme/components/modals/download-icons/download-icons.component.ts b/src/app/@theme/components/modals/download-icons/download-icons.component.ts index 87859a2..707ac63 100644 --- a/src/app/@theme/components/modals/download-icons/download-icons.component.ts +++ b/src/app/@theme/components/modals/download-icons/download-icons.component.ts @@ -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]) { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a07d202..46d260c 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -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(), diff --git a/src/app/pages/outline/outline.component.ts b/src/app/pages/outline/outline.component.ts index db94b85..99fdfb3 100644 --- a/src/app/pages/outline/outline.component.ts +++ b/src/app/pages/outline/outline.component.ts @@ -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() { diff --git a/src/proxy.conf.json b/src/proxy.conf.json new file mode 100644 index 0000000..b1b00ab --- /dev/null +++ b/src/proxy.conf.json @@ -0,0 +1,8 @@ +{ + "/api": { + "target": "http://localhost:3000", + "secure": false, + "changeOrigin": true, + "logLevel": "debug" + } +}