Professional Documents
Culture Documents
Install Ionic
1.
2.
Make sure you are in the phonegap-workshop-jquk2014 directory, and create the
project:
ionic start conference
3.
4.
5.
6.
7.
2.
<ion-view title="Sessions">
<ion-nav-buttons side="left">
<button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
</ion-nav-buttons>
<ion-content class="has-header">
<ion-list>
<ion-item ng-repeat="session in sessions" href="#/app/sessions/{{session.id}}">
{{session.title}}
</ion-item>
</ion-list>
</ion-content>
</ion-view>
3.
4.
5.
6.
services.js uses the Angular resource module: in index.html, add a script tag to
include angular-resource.min.js (right after ionic-bundle.js):
<script src="lib/ionic/js/angular/angular-resource.min.js"></script>
7.
8.
9.
10.
2.
}
}
});
3.
4.
2.
3.
4.
5.
Open www/templates/menu.html, delete the Search and Browse menu items, and
add the following menu item:
<ion-item nav-clear menu-close href="#/app/login">
Login
</ion-item>
6.
In the templates folder, create a new file name login.html and implement it as
follows:
<ion-view title="Login">
<ion-nav-buttons side="left">
<button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
</ion-nav-buttons>
<ion-content class="has-header padding">
7.
Open app.js, and initialize OpenFB in the config() function (first line):
openFB.init('YOUR_FB_APP_ID'); // Defaults to sessionStorage for storing the Facebook token
8.
Delete the search and browse routes, and add the following route:
.state('app.login', {
url: "/login",
views: {
'menuContent' :{
templateUrl: "templates/login.html",
controller: "LoginCtrl"
}
}
})
9.
10.
2.
In the templates folder, create a new file named profile.html and implement it as
follows:
<ion-view title="Profile">
<ion-content class="has-header">
<div class="list card">
<div class="item">
<h2>{{user.name}}</h2>
<p>{{user.city}}</p>
</div>
<div class="item item-body">
<img src="http://graph.facebook.com/{{user.id}}/picture?
width=270&height=270"/>
</div>
</div>
</ion-content>
</ion-view>
3.
4.
5.