Accessing _embedded in Json ResponseSafely turning a JSON string into an objectHow do I format a Microsoft JSON date?Can comments be used in JSON?How can I pretty-print JSON in a shell script?What is the correct JSON content type?Why does Google prepend while(1); to their JSON responses?Why can't Python parse this JSON data?How can I pretty-print JSON using JavaScript?Parse JSON in JavaScript?How do I POST JSON data with Curl from a terminal/commandline to Test Spring REST?
Does cashing a 3% share harm the company itself?
Why is Carbon Dioxide a Greenhouse Gas whereas Ammonia is not?
QGIS incredibly slow when trying to update large tables?
What is the difference between the Ancient Greek religion and the Ancient Roman religion?
PyQgis difference iteration
Potential Postdoc advisor giving exams (assignment) as part of hiring process
Complete the Pointer Set
How to wire for AC mains voltage relay, when printer board is connected to AC-charging laptop computer?
Dodging a Deathbeam travelling at speed of light
Can a sauce with dairy be jarred?
Is the MCU origin for the "Avengers” name consistent with the comics?
How do I recall Gooigi in co-op mode?
Why doesn't std::swap work on vector<bool> elements under Clang/Win?
Languages which changed their writing direction
Feasibility of keeping an Electrical Bike in poor (wet) storage conditions
What potential problems are there with dumping dex in bard build?
Why is the air inside airliners so dry (low humidity)?
When is the best time to visit the Australian outback?
Did the disagreement between the Catholic Church and Protestant Church on the issue of salvation by grace alone end 1999?
Did Catherine the Great really call for the abolition of serfdom?
How to deal with a 6 year old who was "caught" cheating?
Are there any galaxies visible in the night sky around the Orion constellation?
How to duplicate all folders into same directory?
Converting a Scheme function to Emacs Lisp
Accessing _embedded in Json Response
Safely turning a JSON string into an objectHow do I format a Microsoft JSON date?Can comments be used in JSON?How can I pretty-print JSON in a shell script?What is the correct JSON content type?Why does Google prepend while(1); to their JSON responses?Why can't Python parse this JSON data?How can I pretty-print JSON using JavaScript?Parse JSON in JavaScript?How do I POST JSON data with Curl from a terminal/commandline to Test Spring REST?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
Trouble accessing the _embedded property in Json in Angular. Is it even possible?
Json response created using Spring-Data-Jpa looks like this:
"_embedded":
"reviews": [
"author": "Anonymous",
"content": "This movie sucks",
"upvotes": 0,
"downvotes": 0,
"_links":
"self":
"href": "http://localhost:8080/api/reviews/1"
,
"review":
"href": "http://localhost:8080/api/reviews/1"
,
"film":
"href": "http://localhost:8080/api/reviews/1/film"
, ...
]
,
"_links":
"self":
"href": "http://localhost:8080/api/reviews?page,size,sort",
"templated": true
,
"profile":
"href": "http://localhost:8080/api/profile/reviews"
,
"page":
"size": 20,
"totalElements": 6,
"totalPages": 1,
"number": 0
From my Client app I would like to process reviews nested in the embedded field. However I cannot get to the _embedded property. My Angular Service looks like this:
getEmbedded(): Observable<any>
return this.http.get(ServerConfig.serverAddress + '/api/reviews');
Component using the service:
export class ReviewListComponent implements OnInit {
embeddedReviewResource: any;
constructor(private reviewService: ReviewService)
ngOnInit()
this.reviewService.getEmbedded().subscribe(data =>
this.embeddedReviewResource = data;
);
I tried referncing the _embedded property in a number of ways in my view:
*ngFor="let review of embeddedReviewResource.reviews
or
*ngFor="let review of embeddedReviewResource._embedded.reviews
or
*ngFor="let review of embeddedReviewResource.getEmbedded().reviews
or
*ngFor="let review of embeddedReviewResource._embeddedViews.reviews
None of theses seems to do the trick. How can I access _embedded property in the Json File?
Full source code is available at my GitHub.
json angular typescript spring-data-jpa
add a comment
|
Trouble accessing the _embedded property in Json in Angular. Is it even possible?
Json response created using Spring-Data-Jpa looks like this:
"_embedded":
"reviews": [
"author": "Anonymous",
"content": "This movie sucks",
"upvotes": 0,
"downvotes": 0,
"_links":
"self":
"href": "http://localhost:8080/api/reviews/1"
,
"review":
"href": "http://localhost:8080/api/reviews/1"
,
"film":
"href": "http://localhost:8080/api/reviews/1/film"
, ...
]
,
"_links":
"self":
"href": "http://localhost:8080/api/reviews?page,size,sort",
"templated": true
,
"profile":
"href": "http://localhost:8080/api/profile/reviews"
,
"page":
"size": 20,
"totalElements": 6,
"totalPages": 1,
"number": 0
From my Client app I would like to process reviews nested in the embedded field. However I cannot get to the _embedded property. My Angular Service looks like this:
getEmbedded(): Observable<any>
return this.http.get(ServerConfig.serverAddress + '/api/reviews');
Component using the service:
export class ReviewListComponent implements OnInit {
embeddedReviewResource: any;
constructor(private reviewService: ReviewService)
ngOnInit()
this.reviewService.getEmbedded().subscribe(data =>
this.embeddedReviewResource = data;
);
I tried referncing the _embedded property in a number of ways in my view:
*ngFor="let review of embeddedReviewResource.reviews
or
*ngFor="let review of embeddedReviewResource._embedded.reviews
or
*ngFor="let review of embeddedReviewResource.getEmbedded().reviews
or
*ngFor="let review of embeddedReviewResource._embeddedViews.reviews
None of theses seems to do the trick. How can I access _embedded property in the Json File?
Full source code is available at my GitHub.
json angular typescript spring-data-jpa
add a comment
|
Trouble accessing the _embedded property in Json in Angular. Is it even possible?
Json response created using Spring-Data-Jpa looks like this:
"_embedded":
"reviews": [
"author": "Anonymous",
"content": "This movie sucks",
"upvotes": 0,
"downvotes": 0,
"_links":
"self":
"href": "http://localhost:8080/api/reviews/1"
,
"review":
"href": "http://localhost:8080/api/reviews/1"
,
"film":
"href": "http://localhost:8080/api/reviews/1/film"
, ...
]
,
"_links":
"self":
"href": "http://localhost:8080/api/reviews?page,size,sort",
"templated": true
,
"profile":
"href": "http://localhost:8080/api/profile/reviews"
,
"page":
"size": 20,
"totalElements": 6,
"totalPages": 1,
"number": 0
From my Client app I would like to process reviews nested in the embedded field. However I cannot get to the _embedded property. My Angular Service looks like this:
getEmbedded(): Observable<any>
return this.http.get(ServerConfig.serverAddress + '/api/reviews');
Component using the service:
export class ReviewListComponent implements OnInit {
embeddedReviewResource: any;
constructor(private reviewService: ReviewService)
ngOnInit()
this.reviewService.getEmbedded().subscribe(data =>
this.embeddedReviewResource = data;
);
I tried referncing the _embedded property in a number of ways in my view:
*ngFor="let review of embeddedReviewResource.reviews
or
*ngFor="let review of embeddedReviewResource._embedded.reviews
or
*ngFor="let review of embeddedReviewResource.getEmbedded().reviews
or
*ngFor="let review of embeddedReviewResource._embeddedViews.reviews
None of theses seems to do the trick. How can I access _embedded property in the Json File?
Full source code is available at my GitHub.
json angular typescript spring-data-jpa
Trouble accessing the _embedded property in Json in Angular. Is it even possible?
Json response created using Spring-Data-Jpa looks like this:
"_embedded":
"reviews": [
"author": "Anonymous",
"content": "This movie sucks",
"upvotes": 0,
"downvotes": 0,
"_links":
"self":
"href": "http://localhost:8080/api/reviews/1"
,
"review":
"href": "http://localhost:8080/api/reviews/1"
,
"film":
"href": "http://localhost:8080/api/reviews/1/film"
, ...
]
,
"_links":
"self":
"href": "http://localhost:8080/api/reviews?page,size,sort",
"templated": true
,
"profile":
"href": "http://localhost:8080/api/profile/reviews"
,
"page":
"size": 20,
"totalElements": 6,
"totalPages": 1,
"number": 0
From my Client app I would like to process reviews nested in the embedded field. However I cannot get to the _embedded property. My Angular Service looks like this:
getEmbedded(): Observable<any>
return this.http.get(ServerConfig.serverAddress + '/api/reviews');
Component using the service:
export class ReviewListComponent implements OnInit {
embeddedReviewResource: any;
constructor(private reviewService: ReviewService)
ngOnInit()
this.reviewService.getEmbedded().subscribe(data =>
this.embeddedReviewResource = data;
);
I tried referncing the _embedded property in a number of ways in my view:
*ngFor="let review of embeddedReviewResource.reviews
or
*ngFor="let review of embeddedReviewResource._embedded.reviews
or
*ngFor="let review of embeddedReviewResource.getEmbedded().reviews
or
*ngFor="let review of embeddedReviewResource._embeddedViews.reviews
None of theses seems to do the trick. How can I access _embedded property in the Json File?
Full source code is available at my GitHub.
json angular typescript spring-data-jpa
json angular typescript spring-data-jpa
asked Mar 28 at 21:27
Jan ChabikJan Chabik
294 bronze badges
294 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
reviews = [];
this.reviewService.getEmbedded().subscribe(data =>
this.reviews = data._embedded.reviews;
);
template
<div *ngFor="let review of reviews">
review.content
</div>
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407108%2faccessing-embedded-in-json-response%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
reviews = [];
this.reviewService.getEmbedded().subscribe(data =>
this.reviews = data._embedded.reviews;
);
template
<div *ngFor="let review of reviews">
review.content
</div>
add a comment
|
reviews = [];
this.reviewService.getEmbedded().subscribe(data =>
this.reviews = data._embedded.reviews;
);
template
<div *ngFor="let review of reviews">
review.content
</div>
add a comment
|
reviews = [];
this.reviewService.getEmbedded().subscribe(data =>
this.reviews = data._embedded.reviews;
);
template
<div *ngFor="let review of reviews">
review.content
</div>
reviews = [];
this.reviewService.getEmbedded().subscribe(data =>
this.reviews = data._embedded.reviews;
);
template
<div *ngFor="let review of reviews">
review.content
</div>
answered Mar 28 at 22:19
jcuypersjcuypers
1,4191 gold badge11 silver badges19 bronze badges
1,4191 gold badge11 silver badges19 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407108%2faccessing-embedded-in-json-response%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown