feat(navclear): Ability to disable the next view transition and back button

This commit is contained in:
Adam Bradley
2014-03-18 21:51:32 -05:00
5 changed files with 102 additions and 23 deletions

View File

@@ -315,5 +315,36 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie
};
}
};
});
})
/**
* @ngdoc directive
* @name menuClose
* @module ionic
* @restrict AC
*
* @description
* Closes a side menu which is currently opened.
*
* @usage
* Below is an example of a link within a side menu. Tapping this link would
* automatically close the currently opened menu
*
* ```html
* <a nav-clear menu-close href="#/home" class="item">Home</a>
* ```
*/
.directive('menuClose', ['$ionicViewService', function($ionicViewService) {
return {
restrict: 'AC',
require: '^ionSideMenus',
link: function($scope, $element, $attr, sideMenuCtrl) {
$element.bind('click', function(){
sideMenuCtrl.close();
});
}
};
}]);
})();