tabs.js 767 B

12345678910111213141516171819202122
  1. (function (module) {
  2. module.controller('tabsCtrl', ["$scope","$http", "myService","storage", "$ionicHistory", "$state", function ($scope,$http, myService, storage,$ionicHistory, $state) {
  3. $scope.go = function(target) {
  4. $ionicHistory.clearHistory();
  5. if($state.current.name=="app.home"&&target=="app.add"){
  6. target = "app.home_add"
  7. }
  8. if($state.current.name=="app.my"&&target=="app.add"){
  9. target = "app.my_add"
  10. }
  11. $state.go(target);
  12. };
  13. $scope.myMes = function(){
  14. $scope.go("app.my")
  15. };
  16. $scope.myIndex = function(){
  17. $scope.go("app.home")
  18. };
  19. }]);
  20. })(angular.module('app.controllers'));