changeset 89:f5072712ddf5

Resurrect the duck!
author Lucas Thompson <dev@lucas.im>
date Thu, 23 Feb 2017 16:21:51 +0000
parents 4aa6b1266251
children 80b98dd50c88
files src/app/app.component.html src/app/app.component.ts src/app/app.module.ts
diffstat 3 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/app/app.component.html	Thu Feb 23 16:13:38 2017 +0000
+++ b/src/app/app.component.html	Thu Feb 23 16:21:51 2017 +0000
@@ -1,5 +1,5 @@
 <md-toolbar color="primary">
-  <md-icon svgSrc="assets/duck.svg"></md-icon>
+  <md-icon svgIcon="duck"></md-icon>
   <!-- This fills the remaining space of the current row -->
   <span class="app-toolbar-filler"></span>
 
--- a/src/app/app.component.ts	Thu Feb 23 16:13:38 2017 +0000
+++ b/src/app/app.component.ts	Thu Feb 23 16:21:51 2017 +0000
@@ -2,6 +2,8 @@
 import {AudioPlayerService} from "./services/audio-player/audio-player.service";
 import {FeatureExtractionService} from "./services/feature-extraction/feature-extraction.service";
 import {ExtractorOutputInfo} from "./feature-extraction-menu/feature-extraction-menu.component";
+import {DomSanitizer} from '@angular/platform-browser';
+import {MdIconRegistry} from '@angular/material';
 
 @Component({
   selector: 'app-root',
@@ -13,8 +15,14 @@
   canExtract: boolean;
 
   constructor(private audioService: AudioPlayerService,
-              private piperService: FeatureExtractionService) {
+              private piperService: FeatureExtractionService,
+              private iconRegistry: MdIconRegistry,
+              private sanitizer: DomSanitizer) {
     this.canExtract = false;
+    iconRegistry.addSvgIcon(
+      'duck',
+      sanitizer.bypassSecurityTrustResourceUrl('assets/duck.svg')
+    );
   }
 
   onFileOpened(file: File) {
--- a/src/app/app.module.ts	Thu Feb 23 16:13:38 2017 +0000
+++ b/src/app/app.module.ts	Thu Feb 23 16:21:51 2017 +0000
@@ -31,7 +31,7 @@
     BrowserModule,
     FormsModule,
     HttpModule,
-    MaterialModule.forRoot()
+    MaterialModule
   ],
   providers: [
     {provide: HTMLAudioElement, useValue: new Audio()}, // TODO use something more generic than HTMLAudioElement