Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Split a string from each object inside array

$
0
0

@dipankar123 wrote:

hi guys,
i am new in ionic 2
i want to split a string from each object inside array

i have a array like this:
array = [

{
'name": ''name1",
time: time1,
workToDo: ‘work1 \n work2 \n work3}’ ,

{'name": ''name3",
time: time2,
workToDo: ‘work1 \n work2 \n work3}’ ,

{'name": ''name1",
time: time3,
workToDo: ‘work1 \n work2 \n work3’
}
]

i want to split workToDo value by \n
and want to show this balue in browser

in html:

<div *ngFor="let item of array">
   <p>{{item.name}}</p>
   <p>{{item.time}}</p>
   <div>
      {{ item.workToDo}}
   </div>
</div>

please help me
i want to show {{ item.workToDo }} as a list format like this this attached bellow

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>