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

3
.gitignore vendored
View File

@@ -265,3 +265,6 @@ __pycache__/
# Mac
.DS_Store
# Angular
dist

View File

@@ -6,10 +6,10 @@
</button>
</div>
<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-content>
<p>{{ song.Text }}</p>
<p *ngFor="let line of text">{{ line }}</p>
</mat-card-content>
<mat-card-actions>
<button mat-button (click)="onClickDownload()">Herunterladen</button>

View File

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