Escolar Documentos
Profissional Documentos
Cultura Documentos
BASICS +
MOBILE +
BIG DATA +
NOSQL
CLOUD
RECENT POSTS
How to set cursor:pointer to html File
Upload input
September 28, 2016
Dierence between IaaS and PaaS
September 21, 2016
Ways to Clear/Fill the Input eld with
Selenium
September 8, 2016
Hacker types (White | Grey | Black hat)
August 24, 2016
In this article we will customize the default generated Ionic app to fetch some
JSON data from the remote API using HTTP GET-request.
TAGS
At rst, you should look again to a previous lesson were we used to learn how
ambari
cordova
apache ink
css
big data
hortonworks
cloud
html
iaas
ionic
mongodb
react.js
spark
java
nosql
redis
sql
map reduce
paas
react-native
saas
selenium
unity3d
unity ads
xml
yarn
25% OFF
www/templates/tab-dash.html
Xiaomi Mi Powerbank
10000 mAh Original Silver
Online lebih lama dengan
powerbank andalan dar
Rp 195.000
Rp 145.000
Lets start from the rst le controllers.js. There is a section for DashCtrl
(Dashboard Controller) with an empty function. This is how it should be
Klik Disini
changed:
The code above uses $http to send a GET request to API that returns the JSON
for current date and time:
{
"time": "09:53:53 PM",
"milliseconds_since_epoch": 1458510833266,
"date": "03-20-2016"
}
Now, all we need to do is to use the result data on the screen. Open tabdash.html and replace its content with this:
<ion-view view-title="Dashboard">
<ion-content class="padding">
<h2>Ionic GET Json Example</h2>
Current time: {{result.time}}
</ion-content>
</ion-view>
As you can see, we refer to results time eld using Angular expression
language.
Now we need to run this code in browser or on your device.
To run in browser just executethis command in the project directory:
#ionic
PREVIOUS
Google+
NEXT
LE AVE A RE P LY
10 Comments on "Ionic HTTP GET Json"
Jointhediscussion
edoardo
Guest
aalfiann
Guest
18days14hoursago
ReplyShare
25days17hoursago
awesome, its works for me.. But how if I want to get http json api using
parameter? thanks
0
ReplyShare
10minbasics
Author
ReplyShare
vbcabc
5months4daysago
Hai for me also its giving data error response :( Could you please help me
i am new to ionic and i gt frustrated of searching json
0
ReplyShare
10minbasics
Author
HideReplies
5months4daysago
Hello. What error does it return? Can you see the json data when
you hit http://date.jsontest.com/ in your browser?
0
ReplyShare
juan
Guest
25days17hoursago
Guest
HideReplies
5months14daysago
hi i tried this tutorial but the url wont work, although y used another url I
didnt recieved anything
1
ReplyShare
HideReplies
10minbasics
5months13daysago
Hi, Juan. Sorry for a long reply. I have just paste in a browser
http://date.jsontest.com/ and it returned a valid json.
Can you show your code?
Author
ReplyShare
Periyasamy
Guest
5months17daysago
ReplyShare
10minbasics
Author
HideReplies
5months13daysago
ReplyShare
Priyanka
Guest
17days22hoursago
same way can you let us know how to show data in ionic in
frontend using Mvc.java as backend(.like simple login and
register)
0
ReplyShare
RECENT POSTS