diff --git a/www/index.html b/www/index.html index 66fba3e..87d4978 100644 --- a/www/index.html +++ b/www/index.html @@ -20,15 +20,10 @@ + + - - - -

Ionic Blank Starter

-
- - -
+ diff --git a/www/js/app.js b/www/js/app.js index a82faf1..207668c 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -3,7 +3,7 @@ // 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 attribute in index.html) // the 2nd parameter is an array of 'requires' -angular.module('ddApp', ['ionic']) +angular.module('ddApp', ['ionic', 'ddApp.services', 'ddApp.controllers']) .run(function($ionicPlatform) { $ionicPlatform.ready(function() { @@ -17,3 +17,42 @@ angular.module('ddApp', ['ionic']) } }); }) +.config(function ($stateProvider, $urlRouterProvider, $ionicConfigProvider) { + $stateProvider + .state( + 'login', { + url: '/login', + templateUrl: 'templates/login.html', + controller: 'LoginCtrl' + }) + .state( + 'list', { + url: '/list', + templateUrl: 'templates/list.html', + controller: 'ListCtrl' + }) + .state( + 'scan', { + url: '/scan', + templateUrl: 'templates/scan.html', + controller: 'ScanCtrl' + }) + .state( + 'manual', { + url: '/manual', + templateUrl: 'templates/manual.html', + controller: 'ManualCtrl' + }) + .state( + 'detail', { + url: '/detail/:orderId', + templateUrl: 'templates/detail.html', + controller: 'DetailCtrl' + }) + + // if none of the above states are matched, use this as the fallback + $urlRouterProvider.otherwise('/login'); + + $ionicConfigProvider.tabs.style('ios'); //even if you're on android + $ionicConfigProvider.tabs.position('ios'); //even if you're on android +}); \ No newline at end of file diff --git a/www/js/controllers.js b/www/js/controllers.js new file mode 100644 index 0000000..545b724 --- /dev/null +++ b/www/js/controllers.js @@ -0,0 +1,38 @@ +/** + * Created by sczhang on 8/4/15. + */ +angular.module('ddApp.controllers', ['ddApp.services']) + .controller('LoginCtrl', function ($scope, $state, $ionicPopup, $ionicHistory, $ionicViewSwitcher, $ionicLoading) { + $scope.doLogin = function() { + $state.go('list', {}, {reload: true}); + } + }) + .controller('ListCtrl', function ($scope, $state, $ionicPopup, $ionicHistory, $ionicViewSwitcher, $ionicLoading) { + $scope.goDetail = function() { + $state.go('detail', {}, {reload: true}); + }; + $scope.goScan = function() { + $state.go('scan'); + }; + $scope.goManual = function() { + $state.go('manual'); + }; + $scope.doExit = function(){ + $state.go('login'); + } + }) + .controller('DetailCtrl', function ($scope, $state, $ionicPopup, $ionicHistory, $ionicViewSwitcher, $ionicLoading) { + $scope.goList = function() { + $state.go('list', {}, {reload: true}); + } + }) + .controller('ManualCtrl', function ($scope, $state, $ionicPopup, $ionicHistory, $ionicViewSwitcher, $ionicLoading) { + $scope.goDetail = function() { + $state.go('detail', {}, {reload: true}); + }; + }) + .controller('ScanCtrl', function ($scope, $state, $ionicPopup, $ionicHistory, $ionicViewSwitcher, $ionicLoading) { + $scope.goDetail = function() { + $state.go('detail', {}, {reload: true}); + }; + }) \ No newline at end of file diff --git a/www/js/services.js b/www/js/services.js new file mode 100644 index 0000000..1b771d9 --- /dev/null +++ b/www/js/services.js @@ -0,0 +1,5 @@ +/** + * Created by sczhang on 8/4/15. + */ + +angular.module('ddApp.services', []); \ No newline at end of file diff --git a/www/templates/detail.html b/www/templates/detail.html new file mode 100644 index 0000000..80436b5 --- /dev/null +++ b/www/templates/detail.html @@ -0,0 +1,3 @@ +

Detail

+ + \ No newline at end of file diff --git a/www/templates/list.html b/www/templates/list.html new file mode 100644 index 0000000..5b482db --- /dev/null +++ b/www/templates/list.html @@ -0,0 +1,11 @@ +

List

+ + + + + + + +

+ +

diff --git a/www/templates/login.html b/www/templates/login.html new file mode 100644 index 0000000..821b20e --- /dev/null +++ b/www/templates/login.html @@ -0,0 +1,3 @@ +

Login

+ + \ No newline at end of file diff --git a/www/templates/manual.html b/www/templates/manual.html new file mode 100644 index 0000000..4e061a7 --- /dev/null +++ b/www/templates/manual.html @@ -0,0 +1,3 @@ +

Manual

+ + \ No newline at end of file diff --git a/www/templates/scan.html b/www/templates/scan.html new file mode 100644 index 0000000..d7cd66c --- /dev/null +++ b/www/templates/scan.html @@ -0,0 +1,3 @@ +

Scan

+ + \ No newline at end of file