b836aca999
This commit was worked on by a number of people including @filipesilva, @gkalpak and @wardbell. It contains changes that: * remove unused files, * fix the bootstrap approach to ensure that bootstrap is in the correct Zone * fix unclosed code-example tags * replace use of "we" with "you" * remove broken dual router example Related to angular/angular.io#3541
28 lines
666 B
TypeScript
28 lines
666 B
TypeScript
// #docplaster
|
|
// #docregion
|
|
import { Component } from '@angular/core';
|
|
import { ActivatedRoute } from '@angular/router';
|
|
|
|
import { Phone, PhoneData } from '../core/phone/phone.service';
|
|
|
|
@Component({
|
|
selector: 'phone-detail',
|
|
templateUrl: './phone-detail.template.html'
|
|
})
|
|
export class PhoneDetailComponent {
|
|
phone: PhoneData;
|
|
mainImageUrl: string;
|
|
|
|
constructor(activatedRoute: ActivatedRoute, phone: Phone) {
|
|
phone.get(activatedRoute.snapshot.params['phoneId'])
|
|
.subscribe((p: PhoneData) => {
|
|
this.phone = p;
|
|
this.setImage(p.images[0]);
|
|
});
|
|
}
|
|
|
|
setImage(imageUrl: string) {
|
|
this.mainImageUrl = imageUrl;
|
|
}
|
|
}
|