diff --git a/assets/package.json b/assets/package.json index 3071aab..b888706 100644 --- a/assets/package.json +++ b/assets/package.json @@ -63,4 +63,4 @@ "tslint": "~5.11.0", "typescript": "~3.1.6" } -} +} \ No newline at end of file diff --git a/assets/src/app/app.component.ts b/assets/src/app/app.component.ts index 5ac9619..fa3c386 100644 --- a/assets/src/app/app.component.ts +++ b/assets/src/app/app.component.ts @@ -11,6 +11,7 @@ import { Title } from '@angular/platform-browser'; styleUrls: ['./app.component.css'], providers: [AuthService] }) + export class AppComponent implements OnInit { usersForm; errors; diff --git a/assets/src/app/app.module.ts b/assets/src/app/app.module.ts index a7827e1..5474a5d 100644 --- a/assets/src/app/app.module.ts +++ b/assets/src/app/app.module.ts @@ -5,10 +5,9 @@ import { RouterModule, Routes } from "@angular/router"; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { AppRoutingModule } from './app-routing.module'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations' +import { Select2Module } from 'ng2-select2'; import { polyfill } from 'keyboardevent-key-polyfill'; import { TextInputAutocompleteModule } from 'angular-text-input-autocomplete'; -import { NgbPaginationModule, NgbAlertModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; //Service import { TokenService } from './commons/services/interceptors/token.service'; @@ -55,9 +54,6 @@ polyfill(); FormsModule, ReactiveFormsModule, TextInputAutocompleteModule, - NgbPaginationModule, - NgbAlertModule, - NgbModule, RouterModule.forRoot(routes, {onSameUrlNavigation: 'reload'}), ], providers: [ diff --git a/assets/src/app/components/home/home.component.ts b/assets/src/app/components/home/home.component.ts index 222f831..8da9961 100644 --- a/assets/src/app/components/home/home.component.ts +++ b/assets/src/app/components/home/home.component.ts @@ -16,46 +16,52 @@ const categories = ['Angular JS','E-Commerce','General','Bootstrap 4']; export class HomeComponent implements OnInit { themes; category; + categories searchCategory; + promise; baseUrl = "http://localhost:8000/media/"; constructor( - private home: HomeService, - private title: Title) {} + private home: HomeService, + private title: Title, + private fb: FormBuilder) {} ngOnInit() { - this.getThemesHome(); - this.title.setTitle('Home - Marketplace'); + this.getThemesHome(); + this.title.setTitle('Home - Marketplace'); + console.log(this.home.categories); } getThemesHome(){ - this.home.getThemes() - .then( - response => { - this.themes = response.data; - this.category = response.category - return response; - } - ) - .catch( - error => { - return error; - } - ) + this.home.getThemes() + .then( + response => { + this.themes = response.data; + this.category = response.category + return response; + } + ) + .catch( + error => { + return error; + } + ) + } - findCategory(search: string){ - return categories.filter( - category => { - return category.toLowerCase().includes(search.toLowerCase()); - } + findCategory(search: string){ + return categories.filter( + category => { + console.log(category); + return category.toLowerCase().includes(search.toLowerCase()); + } - ); + ); } getChoice(choice: string){ - return `${choice}`; + return `${choice}`; } }