so here is my custom directives sample code
myApp.directive('anchorLink', function () {
return {
restrict: 'EA',
link: function (scope, elem, attr) {
elem.on('click', function () {
scope.show = true;
});
}
};
});
and here's my html markup
<a href="javascript:;" anchor-link>click me</a>
<div ng-show='show'>show me</div>
<div ng-hide='show'>hide me</div>
as you can see I want to manipulate the $scope.show outside the custom directives environment but it didn't work.. can you help me?