You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { Component, OnInit } from '@angular/core'
|
|
|
|
import { Router, NavigationEnd } from '@angular/router'
|
|
|
|
import { ApisService } from '../services/apis.service'
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-portfolio',
|
|
|
|
templateUrl: './portfolio.component.html',
|
|
|
|
styleUrls: ['./portfolio.component.scss']
|
|
|
|
})
|
|
|
|
export class PortfolioComponent implements OnInit {
|
|
|
|
|
|
|
|
public portfolioItems: any = []
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
private apisService: ApisService,
|
|
|
|
private router: Router)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
this.apisService.getPortfolio(this.router.url.split('/')[1]).toPromise().then((response) => {
|
|
|
|
this.portfolioItems = response.items
|
|
|
|
},(error) => {
|
|
|
|
console.error('getPortfolio ERROR', error)
|
|
|
|
}).catch((e) => {
|
|
|
|
console.error('getPortfolio CATCH', e)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
showDetails(id): void {
|
|
|
|
this.router.navigate([`/detail/${id}`])
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|