Skip to content

Instantly share code, notes, and snippets.

@joshhunt
Last active August 29, 2015 13:58
Show Gist options
  • Save joshhunt/10224970 to your computer and use it in GitHub Desktop.
Save joshhunt/10224970 to your computer and use it in GitHub Desktop.
angular.directive('loginRequired', function() {
return {
restrict: 'A',
transclude: true,
template: '<element ng-if="show"><ng-transclude/></element>',
link: function(scope) {
watch(auth.isLoggedIn(), function(){
scope.show = auth.isLoggedIn()
})
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment