(function (module) {
    module.controller('tabsCtrl', ["$scope","$http", "myService", "$ionicHistory", "$state", function ($scope,$http, myService, $ionicHistory, $state) {
        $scope.go = function(target) {
            $ionicHistory.clearHistory();
            if($state.current.name=="app.home"&&target=="app.add"){
                target = "app.home_add"
            }
            if($state.current.name=="app.my"&&target=="app.add"){
                target = "app.my_add"
            }
            $state.go(target);
        };

        $scope.myMes = function(){
            $scope.go("app.my")
        };

        $scope.myIndex = function(){
            $scope.go("app.home")
        };
    }]);
})(angular.module('app.controllers'));