落葉的庭院掃的一乾二淨以後,還要輕輕把樹搖一下,抖落幾片葉子,這纔是Wabi Sabi的境界。css
介紹:Ionic是移動框架,angularjs這就不用說了,ASP.Net MVC WebApi提供數據源,開放數據接口html
快樂學習 Ionic Framework+PhoneGap 手冊1-1{建立APP項目}{點擊查看}android
快樂學習 Ionic Framework+PhoneGap 手冊1-2{介紹Header,Content,Footer的使用}{點擊查看}angularjs
快樂學習 Ionic Framework+PhoneGap 手冊1-3{面板切換}{點擊查看}數據庫
快樂學習 Ionic Framework+PhoneGap 手冊1-4 {登陸頁面}{點擊查看}json
快樂學習 Ionic Framework+PhoneGap 手冊1-5 {IO開關}{點擊查看}gulp
1.安裝WebApiContrib.Formatting.Jsonpapi
2.修改Global.asax.cs瀏覽器
//jsonp GlobalConfiguration.Configuration.AddJsonpFormatter();
3.設計好數據庫,能夠經過這個地址訪問jsonp數據。sass
4.Index頁面代碼,注意這裏要使用angular.js,關鍵代碼
<!DOCTYPE html> <html ng-app="ionicApp"> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <title></title> <link href="lib/ionic/css/ionic.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above <link href="css/ionic.app.css" rel="stylesheet"> --> <script src="js/angular.js"></script> <!-- ionic/angularjs js --> <script src="lib/ionic/js/ionic.bundle.js"></script> <!-- cordova script (this will be a 404 during development) --> <script src="cordova.js"></script> <!-- your app's js --> <script src="js/app.js"></script> </head> <body ng-controller="MyCtrl"> <ion-header-bar class="bar-positive"> <h1 class="title">凡酷網絡</h1> </ion-header-bar> <ion-content> <div class="list"> <a ng-repeat="item in items" href="#/{{item.MenuID}}" class="item item-thumbnail-left"> <img ng-src="http://192.168.1.100/SAS.APPSite/{{ item.MenuIcon }}"> <h2>{{ item.MenuName }}</h2> </a> </div> </ion-content> </body> </html>
5.App Js Code
var phonecatApp =angular.module('ionicApp', ['ionic']) phonecatApp.controller('MyCtrl', function MyCtrl($scope,$http) { $http .jsonp("http://192.168.1.100/SAS.APPSite/api/MenuApi?callback=JSON_CALLBACK") .success(function(data) { // 數據 $scope.items = data; }); });
6.在電腦中瀏覽器顯示效果,效果顯示好後,導入到手機裏面的命令:ionic run android 詳情能夠{點擊查看}方法
7.導入到手機後,運行效果。