Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@
"tslint": "~5.11.0",
"typescript": "~3.1.6"
}
}
}
1 change: 1 addition & 0 deletions assets/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Title } from '@angular/platform-browser';
styleUrls: ['./app.component.css'],
providers: [AuthService]
})

export class AppComponent implements OnInit {
usersForm;
errors;
Expand Down
6 changes: 1 addition & 5 deletions assets/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -55,9 +54,6 @@ polyfill();
FormsModule,
ReactiveFormsModule,
TextInputAutocompleteModule,
NgbPaginationModule,
NgbAlertModule,
NgbModule,
RouterModule.forRoot(routes, {onSameUrlNavigation: 'reload'}),
],
providers: [
Expand Down
54 changes: 30 additions & 24 deletions assets/src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}

}