1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

implementing directory rendering

This commit is contained in:
Braun Patrik 2016-03-20 20:05:51 +01:00
parent 295d728e51
commit 23885f2699
5 changed files with 28 additions and 2 deletions

View File

View File

@ -0,0 +1 @@
<span>{{directory.name}}</span>

View File

@ -0,0 +1,19 @@
///<reference path="../../../browser.d.ts"/>
import {Component, Input, OnInit} from 'angular2/core';
import {Directory} from "../../../../common/entities/Directory";
@Component({
selector: 'gallery-directory',
templateUrl: 'app/gallery/directory/directory.gallery.component.html'
})
export class GalleryDirectoryComponent{
@Input() directory: Directory;
constructor() {
}
}

View File

@ -1,4 +1,8 @@
<h1>Gallery</h1>
<div *ngIf="directory" *ngFor="#directory of directory.directories" >
<gallery-directory *ngIf="directory" [directory]="directory" ></gallery-directory>
</div>
<div *ngIf="directory" *ngFor="#photo of directory.photos" >
<gallery-photo *ngIf="photo" [photo]="photo" >a photo</gallery-photo>
<gallery-photo *ngIf="photo" [photo]="photo" ></gallery-photo>
</div>

View File

@ -7,11 +7,13 @@ import {GalleryService} from "./gallery.service";
import {Directory} from "../../../common/entities/Directory";
import {Message} from "../../../common/entities/Message";
import {GalleryPhotoComponent} from "./photo/photo.gallery.component";
import {GalleryDirectoryComponent} from "./directory/directory.gallery.component";
@Component({
selector: 'gallery',
templateUrl: 'app/gallery/gallery.component.html',
directives:[GalleryPhotoComponent]
directives:[GalleryPhotoComponent,
GalleryDirectoryComponent]
})
export class GalleryComponent implements OnInit{