angular - Wakanda How to access and display the data in mobile side? -


in getting started on wakanda explain how can bind data in web app via angularjs.

http://wakanda.github.io/get-started/bind-data-in-webapp.html 

the mobile app work ionic 2, , want know, how can bind data web app ?

my goal have same result getting started on mobile side. can me ?

you can achieve same result in ionic 2 project using wakanda.service. have :

  1. in home.ts example

    import { wakanda } '../../app/wakanda.service';

  2. add wakanda providers array

    @component({ selector: 'page-home', providers: [wakanda], templateurl: 'home.html' })

  3. add wakanda constructor

    constructor(public navctrl: navcontroller, public wakanda: wakanda) {}

  4. you can use service :

    getheros() { this.wakanda.getcatalog().then(ds => { ds['superhero'].query({orderby:"id desc",pagesize:3}).then(collection => { this.favoritesuperheroes = collection.entities; }); }); }

  5. display heros in home.html :

    <ion-content padding> <button ion-button (click)= getheros()>display heros</button> <ion-list> <ion-item *ngfor="let superhero of favoritesuperheroes">{{superhero.name}} </ion-item> </ion-list> </ion-content>

for more informations how interact wakanda server rest api please refer link wakanda javascript client


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -