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 :
in home.ts example
import { wakanda } '../../app/wakanda.service';
add wakanda providers array
@component({ selector: 'page-home', providers: [wakanda], templateurl: 'home.html' })
add wakanda constructor
constructor(public navctrl: navcontroller, public wakanda: wakanda) {}
you can use service :
getheros() { this.wakanda.getcatalog().then(ds => { ds['superhero'].query({orderby:"id desc",pagesize:3}).then(collection => { this.favoritesuperheroes = collection.entities; }); }); }
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
Post a Comment