tabs.js 891 B

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