我正在尝试集成angular2-odata库。 我正在使用
@Injectable()
class MyODataConfig extends ODataConfiguration{
baseUrl="http://localhost:54872/odata/";
}
bootstrap(app,[
//some of my other providers etc.
provide(ODataConfiguration, {useClass:MyODataConfig}),
ODataServiceFactory,
]
问题在于当我尝试注入ODataServiceFactory时,我收到了以下错误:
异常:实例化ODataConfiguration时出错!(ClassService-> ODataServiceFactory-> ODataConfiguration)。
原始异常:TypeError:不能在没有“new”的情况下调用类构造函数ODataConfiguration
我已经搜索过,似乎在注入扩展类时存在问题,但我无法找到解决方法。任何帮助将不胜感激。
super();
的构造函数。 - Jack GuyODataServiceFactory
实现吗? - Harry Ninh