Skip to content

Conversation

@agustinvinao
Copy link

HttpClient implementation. Part of the changes needs to update from Headers to HttpHeaders.

@coveralls
Copy link

coveralls commented Sep 2, 2017

Coverage Status

Coverage increased (+3.1%) to 86.286% when pulling 176064a on agustinvinao:http-client into 2cbe930 on ghidoz:master.

@coveralls
Copy link

coveralls commented Sep 2, 2017

Coverage Status

Coverage increased (+3.2%) to 86.364% when pulling 30ec4ef on agustinvinao:http-client into 2cbe930 on ghidoz:master.

@jamesdixon
Copy link

Any chance this gets merged soon?

Copy link
Collaborator

@HennerM HennerM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late response.
The change to HttpClient is appreciated, after you have addressed my comments I am happy to merge it publish it as part of the 4.0 release, because this is a breaking change.

package.json Outdated
"repository": {
"type": "git",
"url": "https://github.com/ghidoz/angular2-jsonapi"
"url": "https://github.com/agustinvinao/angular2-jsonapi"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you revert this change please?

package.json Outdated
"license": "MIT",
"bugs": {
"url": "https://github.com/ghidoz/angular2-jsonapi/issues"
"url": "https://github.com/agustinvinao/angular2-jsonapi/issues"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this url as well

@@ -0,0 +1,10 @@
export function HasOne(config: any = {}) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What distinguishes HasOne From `BelongsTo´ ?

@@ -0,0 +1,40 @@
// import {BOOK_PUBLISHED, BOOK_TITLE} from "./author.fixture";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file still needed?

body.data.forEach((data: any) => {
let model: T = new modelType(this, data);
let model: T;
body.data.map((_data: any) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this bet written as
´models = body.data.map( ... ) andreturn model` in the map function?

let requestHeaders = new Headers();
requestHeaders.set('Accept', 'application/vnd.api+json');
requestHeaders.set('Content-Type', 'application/vnd.api+json');
if (this._headers) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this means the user can not set "global" headers anymore. Was this intended?

@HennerM HennerM added this to the v4.0.0 milestone Sep 16, 2017
@agustinvinao
Copy link
Author

Im working to check your comments. I'll update the PL as soon as I can. I've forked the repo and Im using it with this changes, i need to see if all your comments still work on my current project, mainly see if the globals headers works ok.

@safo6m
Copy link
Collaborator

safo6m commented Sep 18, 2017

@agustinvinao you are changing a lot of different things in this pull request. It will be a lot easier and safer for merging if you focus on one change at a time. Can you please create a few smaller pull requests?
Switching to HttpClient would be a great start.

"name": "angular2-jsonapi",
"version": "3.6.0",
"description": "A lightweight Angular 2 adapter for JSON API",
"name": "angular2-jsonapi-adapter",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not change the name, another issue is opened for that matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants