import {Component, OnInit} from '@angular/core';
import {Observable} from 'rxjs/Rx';
import {PhotoAlbum} from '../model/photo-album.service';
import {Photo} from '../model/photo';

@Component({
  moduleId: module.id,
  selector: 'photo-list',
  templateUrl: 'photo-list.component.html',
  styleUrls: ['photo-list.component.css']
})
export class PhotoListComponent implements OnInit {

  photos: Observable<Photo[]>;

  constructor(
    private photoAlbum: PhotoAlbum
  ) { }

  ngOnInit(): void {
    this.photos = this.photoAlbum.getPhotos();
  }
}
