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

Getting data from Json

$
0
0

@JobsMonika wrote:

Thanks in advance.
I am really trying to get data from my json file while the user parsing on the button but it doesn’t work… any help?
New with Ionic
Thanks

my ts

 private tips: any[];
  getData() {
    let localData = this.http.get('/assets/advices.json').map(res => res.json());
    localData.subscribe(data =>{
    this.tips=data;

    })

my html

<button ion-fab (click)="getData()">
    <ion-icon name="search"></ion-icon>
</button>
</ion-content>

including the right providers

Posts: 7

Participants: 3

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>