Skip to content

Commit 798f7df

Browse files
committed
Define CarsService provider
1 parent 20a4cc1 commit 798f7df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

angular2-rest-service/src/app/app.module.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import { NgModule } from '@angular/core';
44
import { FormsModule } from '@angular/forms';
55
import { HttpModule } from '@angular/http';
66
import { RouterModule, Routes } from '@angular/router';
7-
import { AppComponent } from './app.component';
7+
import { CarsService } from 'app/services/cars.service';
88
import { CarsComponent } from './cars/cars.component';
99
import { CarsListingComponent } from './cars-listing/cars-listing.component';
1010
import { CarDetailComponent } from './car-detail/car-detail.component';
1111

12+
import { AppComponent } from './app.component';
13+
1214
const carsRoutes: Routes = [
1315
{ path: 'cars',
1416
component: CarsComponent,
@@ -33,7 +35,7 @@ const carsRoutes: Routes = [
3335
NgbModule.forRoot(),
3436
RouterModule.forRoot( carsRoutes )
3537
],
36-
providers: [],
38+
providers: [CarsService],
3739
bootstrap: [AppComponent]
3840
})
3941
export class AppModule { }

0 commit comments

Comments
 (0)