You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However when enabling the my-category-grid-odata component in the "car.component.html" file, I get error like:
ORIGINAL EXCEPTION: TypeError: class constructors must be invoked with |new|
ORIGINAL STACKTRACE:
MyODataConfig@http://localhost:3000/main.bundle.js:1030:10
anonymous/_View_CarComponent0.prototype.createInternal@CarComponent.ngfactory.js:42:34
Hi,
I think this is related to the build target, which is "es5" in your project. Try out specifying "es2015" if you don't need legacy browser support.
The provide function call syntax is also a bit different, here's the correct one: providers: [ODataServiceFactory, provide(ODataConfiguration, {useClass: MyODataConfig})],
If you want to keep "es5" as your build target, you can use this dirty workaround:
providers: [ ODataServiceFactory, provide(ODataConfiguration, {useFactory: () => {
let odta = new ODataConfiguration();
odta.baseUrl = 'http://services.odata.org/V4/Northwind/Northwind.svc';
return odta;
}}) ],
One thing I've modified, for creating the services please replace "category" with "Categories" cause this will be the OData collection name.
Hi
I'm trying to combine several example projects:
My example project can be found at:
https://github.com/StefH/angular2-webpack-starter
However when enabling the
my-category-grid-odata
component in the "car.component.html" file, I get error like:The providers are loaded as:
Do you have a clue ?
The text was updated successfully, but these errors were encountered: