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;









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.










share|improve this question
































    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.










    share|improve this question




























      0












      0








      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.










      share|improve this question















      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






      share|improve this question














      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 21:27









      Jan ChabikJan Chabik

      294 bronze badges




      294 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          1


















           reviews = []; 

          this.reviewService.getEmbedded().subscribe(data =>
          this.reviews = data._embedded.reviews;
          );


          template



           <div *ngFor="let review of reviews"> 
          review.content
          </div>





          share|improve this answer



























            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
            );



            );














            draft saved

            draft discarded
















            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









            1


















             reviews = []; 

            this.reviewService.getEmbedded().subscribe(data =>
            this.reviews = data._embedded.reviews;
            );


            template



             <div *ngFor="let review of reviews"> 
            review.content
            </div>





            share|improve this answer






























              1


















               reviews = []; 

              this.reviewService.getEmbedded().subscribe(data =>
              this.reviews = data._embedded.reviews;
              );


              template



               <div *ngFor="let review of reviews"> 
              review.content
              </div>





              share|improve this answer




























                1














                1










                1









                 reviews = []; 

                this.reviewService.getEmbedded().subscribe(data =>
                this.reviews = data._embedded.reviews;
                );


                template



                 <div *ngFor="let review of reviews"> 
                review.content
                </div>





                share|improve this answer














                 reviews = []; 

                this.reviewService.getEmbedded().subscribe(data =>
                this.reviews = data._embedded.reviews;
                );


                template



                 <div *ngFor="let review of reviews"> 
                review.content
                </div>






                share|improve this answer













                share|improve this answer




                share|improve this answer










                answered Mar 28 at 22:19









                jcuypersjcuypers

                1,4191 gold badge11 silver badges19 bronze badges




                1,4191 gold badge11 silver badges19 bronze badges

































                    draft saved

                    draft discarded















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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









                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript