fix: song details

This commit is contained in:
Benjamin Ifland
2019-03-23 17:36:33 +01:00
parent 3b060ebf55
commit f453165f88
3 changed files with 18 additions and 11 deletions

5
.gitignore vendored
View File

@@ -264,4 +264,7 @@ __pycache__/
*/*/App_Data/* */*/App_Data/*
# Mac # Mac
.DS_Store .DS_Store
# Angular
dist

View File

@@ -6,10 +6,10 @@
</button> </button>
</div> </div>
<mat-card-title>{{ song.Name }}</mat-card-title> <mat-card-title>{{ song.Name }}</mat-card-title>
<mat-card-subtitle>{{ song.Key }} - {{ song.Velocity }}</mat-card-subtitle> <mat-card-subtitle>{{ song.Key }} - {{ song.Tempo }}</mat-card-subtitle>
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>
<p>{{ song.Text }}</p> <p *ngFor="let line of text">{{ line }}</p>
</mat-card-content> </mat-card-content>
<mat-card-actions> <mat-card-actions>
<button mat-button (click)="onClickDownload()">Herunterladen</button> <button mat-button (click)="onClickDownload()">Herunterladen</button>

View File

@@ -1,13 +1,13 @@
import { DownloadService } from './../../data/download.service'; import { DownloadService } from "./../../data/download.service";
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from "@angular/core";
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from "@angular/router";
import { faLongArrowAltLeft } from '@fortawesome/free-solid-svg-icons'; import { faLongArrowAltLeft } from "@fortawesome/free-solid-svg-icons";
import { Song } from 'src/app/models/song.model'; import { Song } from "src/app/models/song.model";
@Component({ @Component({
selector: 'app-song', selector: "app-song",
templateUrl: './song.component.html', templateUrl: "./song.component.html",
styleUrls: ['./song.component.less'] styleUrls: ["./song.component.less"]
}) })
export class SongComponent implements OnInit { export class SongComponent implements OnInit {
public song: Song; public song: Song;
@@ -28,4 +28,8 @@ export class SongComponent implements OnInit {
const id = this.song.ID; const id = this.song.ID;
this.downloadService.get(id, false); this.downloadService.get(id, false);
} }
public get text(): string[] {
return this.song.Text.split(/\r?\n/).filter(_ => _ !== ' ');
}
} }