Не получается внедрить http модуль ангуляра в сервис. Натыкаюсь на такую ошибку
EXCEPTION: Can't resolve all parameters for UserService: (?)
//main.ts
import { bootstrap } from '@angular/platform-browser-dynamic';
import { AppComponent } from './app.component';
import { HTTP_PROVIDERS } from '@angular/http';
bootstrap(AppComponent, [HTTP_PROVIDERS])
.catch(err => console.error(err));
//app.component.ts
import { Component } from '@angular/core';
import { MainMenuComponent } from './main-menu/main-menu.component';
@Component({
selector: 'edpt-app',
templateUrl: 'app/app.template.html',
directives: [MainMenuComponent]
})
export class AppComponent { }
//main-menu.component.ts
import { Component } from '@angular/core';
import { UserService } from '../security/user.service';
@Component({
selector: 'main-menu',
templateUrl: 'site/main-menu.template',
providers: [UserService]
})
export class MainMenuComponent {
constructor(private userService: UserService) {
}
}
//user.service.ts
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
@Injectable()
export class UserService {
private loggedIn;
constructor(private http: Http) {
}
}