angular - Angular2 Is it possible to get deep nested json value without using ngFor? -


i getting json object server , object has many nested json object well. far, i've been using *ngfor = "let of data | pipe" (the pipe nested value) , single interpolation {{a.value['somevalue']}} deep nested value of json object other situations isn't serving purpose right since don't want loop json.

is there way nested json value without using ngfor?

the part of json object getting server.

userprofile:  {name: 'jess' university: 'uc berkley' major: 'media communication' birthday: 1994}  categoryinfo:  ["inish work quality"]  currentarea :"ca"  introinfo { experience: [ 0: {company: 'atlas', workingyears: 1, **recletter**:'she on time always,  never late. quality of work high-level.'} 1: {company: 'footstep', workingyears: 2, recletter:'she on time always,  never late. quality of work high-level.'} ] introduction: "hello i'm jess" } 

and if use aforementioned method, loop 4 keys (userprofile, categoryinfo, currentarea, , introinfo) don't want.

how can value that's in bold (recletter) without using *ngfor?

in component, doing this.

 userinfo: userdetailinfo[];     getuserdetail(): void {      this.userdetail.getuserdetail()     .subscribe     (         userinfo => this.userinfo = userinfo,         error => this.errormessage = error         )      } 

and tried in html template didn't work , didn't know how 'recletter'

{{userinfo.experience['0']}} 

please help!

thank in advance

for starters, lets assume experience array same, 2 elements. thing need in html this:

{{ userinfo.experience[0].recletter }} 

in case want loop through whole array exeperience , display recletter can this:

<div *ngfor="let item of userinfo.experience">      {{item.recletter}} </div> 

Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -