Created
August 17, 2017 21:48
-
-
Save zrod/a855e5cc3bd8640c330df3079a4b1d93 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<h1>{{pousada.title}}</h1> | |
<small>{{pousada.location}}</small> | |
<iframe | |
width="600" | |
height="450" | |
frameborder="0" style="border:0" | |
src="https://www.google.com/maps/embed/v1/place?key={{googleMapsKey}} | |
&q=Space+Needle,Seattle+WA" allowfullscreen | |
></iframe> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'rxjs/add/operator/switchMap'; | |
import { Component, OnInit } from '@angular/core'; | |
import { ActivatedRoute, ParamMap } from '@angular/router'; | |
import { Pousada } from '../../services/pousada/pousada'; | |
import { PousadaService } from '../../services/pousada/pousada.service'; | |
@Component({ | |
selector: 'pousada', | |
templateUrl: './pousada-detail.component.html' | |
}) | |
export class PousadaDetailComponent implements OnInit { | |
pousada: Pousada; | |
embedParams: string; | |
googleMapsKey: string; | |
constructor( | |
private pousadaService: PousadaService, | |
private route: ActivatedRoute | |
) { | |
this.embedParams = '365m/data=!3m1!1e3'; | |
this.googleMapsKey = 'abc'; | |
} | |
ngOnInit(): void { | |
this.route.paramMap | |
.switchMap((params: ParamMap) => this.pousadaService.getRecord(params.get('slug'))) | |
.subscribe(pousada => this.pousada = pousada); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment