annotate src/app/app.module.ts @ 40:f7244f2155a3
Setup some scaffolding for bootstrapping a worker and loading into a service, providing a mechanism for implementing most of the logic which runs inside the worker in TypeScript.
author |
Lucas Thompson <dev@lucas.im> |
date |
Thu, 01 Dec 2016 15:46:33 +0000 |
parents |
f6e58c2accb0 |
children |
13f5f228ed98 |
rev |
line source |
angular-cli@0
|
1 import { BrowserModule } from '@angular/platform-browser';
|
angular-cli@0
|
2 import { NgModule } from '@angular/core';
|
angular-cli@0
|
3 import { FormsModule } from '@angular/forms';
|
angular-cli@0
|
4 import { HttpModule } from '@angular/http';
|
angular-cli@0
|
5
|
angular-cli@0
|
6 import { AppComponent } from './app.component';
|
dev@31
|
7 import { MaterialModule } from "@angular/material";
|
dev@5
|
8 import { WaveformComponent } from './waveform/waveform.component';
|
dev@13
|
9 import { AudioFileOpenComponent } from './audio-file-open/audio-file-open.component';
|
dev@21
|
10 import { PlaybackControlComponent } from './playback-control/playback-control.component';
|
dev@37
|
11 import { AudioPlayerService } from "./services/audio-player/audio-player.service";
|
dev@40
|
12 import { FeatureExtractionService } from "./services/feature-extraction/feature-extraction.service";
|
dev@31
|
13
|
dev@31
|
14 function createAudioContext(): AudioContext {
|
dev@31
|
15 return new (
|
dev@31
|
16 (window as any).AudioContext
|
dev@31
|
17 || (window as any).webkitAudioContext
|
dev@31
|
18 )();
|
dev@31
|
19 }
|
angular-cli@0
|
20
|
angular-cli@0
|
21 @NgModule({
|
angular-cli@0
|
22 declarations: [
|
dev@1
|
23 AppComponent,
|
dev@13
|
24 WaveformComponent,
|
dev@21
|
25 AudioFileOpenComponent,
|
dev@21
|
26 PlaybackControlComponent
|
angular-cli@0
|
27 ],
|
angular-cli@0
|
28 imports: [
|
angular-cli@0
|
29 BrowserModule,
|
angular-cli@0
|
30 FormsModule,
|
dev@3
|
31 HttpModule,
|
dev@3
|
32 MaterialModule.forRoot()
|
angular-cli@0
|
33 ],
|
dev@1
|
34 providers: [
|
dev@31
|
35 {provide: HTMLAudioElement, useValue: new Audio()}, // TODO use something more generic than HTMLAudioElement
|
dev@31
|
36 {provide: 'AudioContext', useValue: createAudioContext()}, // use a string token, Safari doesn't seem to like AudioContext
|
dev@40
|
37 AudioPlayerService,
|
dev@40
|
38 FeatureExtractionService
|
dev@1
|
39 ],
|
angular-cli@0
|
40 bootstrap: [AppComponent]
|
angular-cli@0
|
41 })
|
dev@1
|
42 export class AppModule {
|
dev@1
|
43
|
dev@1
|
44 }
|