- ๐ญ Iโm currently working on a plan to save the world
- ๐ฑ Iโm currently learning
graphqlkubernetes
gallayl / angular2-odata Goto Github PK
View Code? Open in Web Editor NEWOData service for Angular2
License: MIT License
OData service for Angular2
License: MIT License
Upgrade to Angular RC6
I'll take a look and make a PR.
It should be:
import { ODataConfiguration, ODataServiceFactory, ODataService } from "angular2-odata";
ใ
See also
angular/angular#11317
I'll try to fix this...
Is it possible to send $batch requests that encapsulate other requests, e.q. MERGE?
Thanks
In my test project : https://github.com/StefH/angular2-webpack-starter
When running this command:
npm run build:prod
I get this error:
ERROR in vendor.69478d51da2d091f9ad7.bundle.js from UglifyJs
SyntaxError: Unexpected token: name (PagedResult) [vendor.69478d51da2d091f9ad7.bundle.js:29019,6]
Any idea ? Maybe related to es5/es5 ?
Question: which version from OData is supported ? V3 and/or V4 ?
Can you please add the option for Count().
In query.ts add method:
private _count: boolean;
public Count(count: boolean): ODataQuery<T>{
this._count= count;
return this;
}
However, this means that the Exec method should return a new object like PagedResult which includes the data and the count. Or maybe better to add a new method ExecWithCount().
Like:
class PagedResult<T> {
data: Observable<Array<T>>;
count: number;
}
I can try to make a PR, but probably you know better how to add this functionality and publish a new npm.
Replace if (!parseInt(entityKey, 10)) {
at https://github.com/gallayl/angular2-odata/blob/master/src/config.ts#L26 with if (isNaN(entityKey)) {
or if (!/^[0-9]*$/.test(entityKey)) {
console.group('parseInt');
console.log(!parseInt('asdf', 10)); // true
console.log(!parseInt('2sdf', 10)); // false <- issue for keys like 35d585e3-a357-4149-922e-61bcda3cf35e
console.log(!parseInt('2345', 10)); // false
console.log(!parseInt(null, 10)); // true
console.log(!parseInt(undefined, 10)); // true
console.groupEnd();
console.group('isNaN');
console.log(isNaN('asdf')); // true
console.log(isNaN('2sdf')); // true
console.log(isNaN('2345')); // false
console.log(isNaN(null)); // false
console.log(isNaN(undefined)); // true
console.groupEnd();
console.group('regex');
console.log(!/^[0-9]*$/.test('asdf')); // true
console.log(!/^[0-9]*$/.test('2sdf')); // true
console.log(!/^[0-9]*$/.test('2345')); // false
console.log(!/^[0-9]*$/.test(null)); // true
console.log(!/^[0-9]*$/.test(undefined)); // true
console.groupEnd();
in buildResourceURL() method you append +'/' at the end of type name.
Please see the specs for odata URL http://www.odata.org/documentation/odata-version-2-0/uri-conventions/
it might depend on what you are doing sometimes could be needed but for most cases it is not needed.
this is an example: http://services.odata.org/Northwind/Northwind.svc/Customers?$filter=substringof('Alfreds', CompanyName) eq true
Please fix it.
Otherwise great lib for odata basic use.
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:
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
The providers are loaded as:
@Component({
templateUrl: './categoryGridOData.component.html',
selector: 'my-category-grid-odata',
providers: [ { provide: ODataConfiguration, useClass: MyODataConfig }, ODataServiceFactory ],
styleUrls: [ './carGrid.component.css']
})
export class CategoryGridODataComponent {
Do you have a clue ?
Project with this package not working in IE11
The simply potentially an extremely useful project, but it has not been updated in 10 months during which Angular itself has been advancing. The version dependencies still point to 2.1.0, which suggests it hasn't even been tested but anything newer.
Is there a fork of the project still "alive" somewhere? Or did it turn out not to be actually useful after all? Or is there a different Angular OData implementation people are using?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.