Browse Source

clean ur

hotfix/class_typo
Dslak 5 years ago
parent
commit
5842899a01
  1. 13
      src/app/app.component.ts
  2. 8
      src/app/detail/detail.component.ts
  3. 9
      src/app/portfolio/portfolio.component.ts

13
src/app/app.component.ts

@ -1,12 +1,17 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'Dslak | new-media arts';
export class AppComponent implements OnInit {
public constructor(private titleService: Title) { }
public constructor() { }
ngOnInit(): void {
this.titleService.setTitle('Dslak | New-media arts')
}
}

8
src/app/detail/detail.component.ts

@ -30,6 +30,7 @@ export class DetailComponent implements OnInit {
imageOffset: '0px',
showDeleteControl: false,
showImageTitle: false,
showArrows: false
}
public galleryImages: GALLERY_IMAGE[] = []
@ -94,7 +95,7 @@ export class DetailComponent implements OnInit {
})
this.loaded = !this.loadedImages.length
this.titleService.setTitle(`Dslak - New media arts | ${this.details.title}`)
this.titleService.setTitle(`Dslak | New-media arts | ${this.details.title}`)
},(error) => {
console.error('getPortfolio ERROR', error)
@ -115,7 +116,7 @@ export class DetailComponent implements OnInit {
} else {
this.location.back()
title = this.router.url.split('/')[2]
this.titleService.setTitle(`Dslak - New media arts | ${title.charAt(0).toUpperCase() + title.slice(1)}`)
this.titleService.setTitle(`Dslak | New media arts | ${title.charAt(0).toUpperCase() + title.slice(1)}`)
}
}
@ -125,9 +126,8 @@ export class DetailComponent implements OnInit {
this.loaded = this.init && this.loadedImages.every( (val) => !val)
}
parseTitle(title): string {
return title.toLowerCase().replace(/[^a-zA-Z0-9]/g, '_')
return title.toLowerCase().replace(/[^a-zA-Z0-9]/g, '-').replace('--', '-').replace('--', '-')
}

9
src/app/portfolio/portfolio.component.ts

@ -75,8 +75,8 @@ export class PortfolioComponent implements OnInit {
showDetails(id, title = ''): void {
const section = this.section == 'exhibitions' ? 'exhibitions' : 'works'
if(title) { this.titleService.setTitle(`Dslak - New media arts | ${title}`) }
this.router.navigate([`/detail/${section}/${id}/${title.toLowerCase().replace(/[^a-zA-Z0-9]/g, '_')}`])
if(title) { this.titleService.setTitle(`Dslak | New-media arts | ${title}`) }
this.router.navigate([`/detail/${section}/${id}/${this.parseTitle(title)}`])
}
onLoad(id): void {
@ -84,4 +84,9 @@ export class PortfolioComponent implements OnInit {
this.loaded = this.init && this.portfolioItems.every( (val) => !val.loading)
}
parseTitle(title): string {
return title.toLowerCase().replace(/[^a-zA-Z0-9]/g, '-').replace('--', '-').replace('--', '-')
}
}

Loading…
Cancel
Save