當我運行下面的項目中,我得到的錯誤: No provider for HttpService! (AppComponent -> HttpService) 有人能幫助我嗎? 我AppComponent: import {Component} from 'angular2/core';
import {HttpService} from "./htttp.service";
@Componen
我試圖使用另一個人的服務實現(github)。 該服務要求將配置傳遞給它。根據回購: You have to configure Neo4jSettings in your bootstrap:
provide('Neo4jSettings', {useValue: {
endpoint: 'http://localhost:7474',
username: 'neo4j'
當注射服務爲組件,我看到的錯誤: One or more of providers "CategoriesComponent" were not defined: [?, [object Object], BrowserXhr, [object Object], [object Object], XHRBackend, [object Object]]. 請幫我解決這個問題。非常感謝 下面是我的代
我想導入angular2中的moment.js庫。 我發現了以下解決方案: import {Component} from 'angular2/core';
import * as moment from 'moment';
@Component({
selector: 'app',
template: require('./app.component.html')
}