Coder Social home page Coder Social logo

Question: POST Example about angular-odata-es5 HOT 4 CLOSED

stefh avatar stefh commented on May 15, 2024
Question: POST Example

from angular-odata-es5.

Comments (4)

StefH avatar StefH commented on May 15, 2024

A POST example looks like this:

const service = factory.CreateService<IEmployee>('Employees');
const employee: IEmployee = {
	EmployeeID: 1,
	FirstName: 'f',
	LastName: 'l',
	City: 'c',
	BirthDate: null,
	Orders: null,
	Boss: null
};

const result = service.Post(employee);

I'll add this as a unit-test...

Does this help you?

from angular-odata-es5.

sachinpsingh avatar sachinpsingh commented on May 15, 2024

Thanks, for the code, I tried this same POST method is not firing up, do i needs to do any other configuration for headers?

from angular-odata-es5.

StefH avatar StefH commented on May 15, 2024

Your issue is maybe related to #54, I'll need to investigate and maybe add some more tests and real POST code in my example project.

from angular-odata-es5.

StefH avatar StefH commented on May 15, 2024

1]
I've added a unit test here:
https://github.com/StefH/angular-odata-es5/blob/master/test/angularODataService.spec.ts#L130
(However I cannot test the headers, see also https://stackoverflow.com/questions/50630377/how-to-use-a-custom-matcher-when-using-tohavebeencalledwith-in-jasmine-test

2]
For the real working code; I've added a post call to the odata api see here: https://github.com/StefH/angular-odata-es5/blob/master/demo/employeeGridOData.component.ts#L46

from angular-odata-es5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.