|
1 | | -import { ChangeDetectorRef, Component } from "@angular/core"; |
| 1 | +import { ChangeDetectorRef, Component, OnInit } from "@angular/core"; |
2 | 2 | import { GetPortfolioService, IPortfolio, MappedTechnology, Technologies, titleRefactoring } from "@valor-software/common-docs"; |
3 | 3 | import { Observable } from "rxjs"; |
4 | | -import { DomSanitizer } from '@angular/platform-browser'; |
| 4 | +import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; |
5 | 5 | import { ITechnologiesCard, technologiesAndServices } from '@valor-software/common-docs'; |
6 | 6 |
|
7 | 7 | const ROUTE = 'ashes-of-creation'; |
@@ -36,13 +36,14 @@ type AshesPortfolio = IPortfolio & { |
36 | 36 | selector: "ashes-page", |
37 | 37 | templateUrl: "./ashes-page.component.html" |
38 | 38 | }) |
39 | | -export class AshesPageComponent { |
| 39 | +export class AshesPageComponent implements OnInit { |
40 | 40 | changeBreadCrumbTitle?: { path: string, title: string }[] = [{ path: ROUTE, title: "Ashes of Creation" }]; |
41 | 41 |
|
42 | 42 | imageSliderButtonClasses = 'bg-yellow_bg_col color-black'; |
43 | 43 |
|
44 | 44 | project$: Observable<AshesPortfolio> = this.getProjectsServ.getPortfolioRequest(ROUTE); |
45 | | - |
| 45 | + videoUrl: SafeResourceUrl = ''; |
| 46 | + project?: AshesPortfolio; |
46 | 47 | technologiesCard: ITechnologiesCard[] = [ |
47 | 48 | { |
48 | 49 | smJustify: "between", |
@@ -93,6 +94,13 @@ export class AshesPageComponent { |
93 | 94 | ) { |
94 | 95 | } |
95 | 96 |
|
| 97 | + ngOnInit(): void { |
| 98 | + this.getProjectsServ.getPortfolioRequest(ROUTE).subscribe((project) => { |
| 99 | + this.project = project; |
| 100 | + this.videoUrl = this.getSafeUrl(this.project?.video); |
| 101 | + }); |
| 102 | + } |
| 103 | + |
96 | 104 | getRouteLink(link: string): string { |
97 | 105 | return titleRefactoring(link); |
98 | 106 | } |
|
0 commit comments