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

                    How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

                    해남서초등학교 학교 연혁 학교 동문 외부 링크 둘러보기 메뉴북위 34° 34′ 21″ 동경 126° 35′ 50″ / 북위 34.5726385° 동경 126.5972670°  / 34.5726385; 126.5972670해남서초등학교eh