Created
June 25, 2013 15:15
-
-
Save c0bra/5859295 to your computer and use it in GitHub Desktop.
ngVisible angular directive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directive('ngVisible', function () { | |
return function (scope, element, attr) { | |
scope.$watch(attr.ngVisible, function (visible) { | |
element.css('visibility', visible ? 'visible' : 'hidden'); | |
}); | |
}; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For those who want to toggle a class (FYI "invisible" is the correct Bootstrap class name, you're welcome:)):