从http://danielstern.github.io/ngAudio/#/安装了ngAudio。 在安装之后,我应该将它包含在app.module.ts中,然后才能在我的项目中使用它。
我对如何在此处包含它感到茫然,因为他们在网站上说的标准“需要项目中的模块:angular.module('yourModule',['ngAudio'])”对我没有任何意义。
我的app.module.ts如下:
//Modules
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule, Route } from '@angular/router';
//routes
const appRoutes: Route[] =
[
{ path: "soundwave", component: SoundwaveComponent },
{ path: "weather", component: WeatherComponent },
{ path: "movies", component: MoviesComponent },
{ path: "moviesearch", component: MoviesearchComponent },
{ path: "news", component: NewsComponent },
]
//services
import { TmdbService } from './services/tmdb.service';
import { NewsService } from './services/news.service';
import { WeatherService } from './services/weather.service';
import { SoundwaveService } from './services/soundwave.service';
//Angular Material
import { MdButtonModule, MdToolbarModule, MdIconModule } from '@angular/material';
//special
import 'hammerjs';
//component
import { AppComponent } from './app.component';
import { MoviesComponent } from './movies/movies.component';
import { MoviesearchComponent } from './moviesearch/moviesearch.component';
import { NewsComponent } from './news/news.component';
import { SoundwaveComponent } from './soundwave/soundwave.component';
import { WeatherComponent } from './weather/weather.component';
//Pipes
import { RoundPipe } from './pipes/round.pipe';
import { SubmitOnEnterDirective } from './directives/submit-on-enter.directive';
@NgModule({
declarations: [AppComponent, MoviesComponent, MoviesearchComponent, NewsComponent, SoundwaveComponent, WeatherComponent, RoundPipe, SubmitOnEnterDirective],
imports: [BrowserModule, FormsModule, HttpModule,
RouterModule.forRoot(appRoutes),
MdButtonModule, MdToolbarModule, MdIconModule
],
exports: [],
providers: [TmdbService, NewsService, WeatherService, SoundwaveService],
bootstrap: [AppComponent]
})
export class AppModule { }
我正在使用的文件夹结构: