// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'starter.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
// Ionic uses AngularUI Router which uses the concept of states
// Learn more here: https://github.com/angular-ui/ui-router
// Set up the various states which the app can be in.
// Each state's controller can be found in controllers.js
$stateProvider
// setup an abstract state for the tabs directive
.state('tab', {
url: '/tab',
abstract: true,
templateUrl: 'tab/tabs.html',
controller: 'TabCtrl'
})
方法如下:
$scope.queryRoomInfo = function(){
var provinceId = $scope.data.currentProvinceId;
var cityId = $scope.data.currentCityId;
var reginId = $scope.data.currentAreaId;
var townId = $scope.data.currentTownId;
var roomCode = $("#roomCode_query").val();
var roomName = $("#roomName_query").val();
$scope.showRoomInfo = function(){
$scope.nif=true;
$scope.pageNum=0;
var staffId = sessionStorage.getItem("staffid");
var isSuperJob = sessionStorage.getItem("issuperjob");
var provinceId = $stateParams.param.provinceId;
var cityId = $stateParams.param.cityId;
var reginId = $stateParams.param.reginId;
var townId = $stateParams.param.townId;
var roomCode = $stateParams.param.roomCode;
var roomName = $stateParams.param.roomName;
var areaId = $scope.data.currentAreaId;
var options = {
url : device.serviceip+'/sdbattery/interceptor/requestInterceptor!requestMain.action',
param: 'type=query&sqlName=runningState.queryRunningStateList&ifPage=y&start='+$scope.pageNum+"&provinceId="+provinceId+"&cityId="+cityId+"®inId="+reginId
+"&townId="+townId+"&roomCode="+roomCode+"&roomName="+roomName+"&staffId="+staffId+"&isSuperJob="+isSuperJob,
type:'AjaxACode',
success:function(json) {
for(var i in json){
if(i=='rValue'){
var rValue=json;
if(json.length<10){
$scope.nif=false;
}
}
}
if($scope.itemsData==null){
$scope.itemsData=rValue;
}else{
var itemlist=$scope.itemsData.concat(rValue);
$scope.itemsData=itemlist;
}
},
error:function(a,b) {
sysop.sysMakeText("服务端接口异常,请联系管理员!");
}
};
new http_oper(options);
}