Skip to content

Instantly share code, notes, and snippets.

@jhanstra
Last active August 29, 2015 14:08
Show Gist options
  • Save jhanstra/bb2a24d88d8bb9f3721c to your computer and use it in GitHub Desktop.
Save jhanstra/bb2a24d88d8bb9f3721c to your computer and use it in GitHub Desktop.
directive test
app.directive('hideWhileLoading', ['$http' ,function ($http)
{
return {
restrict: 'A',
link: function (scope, elm, attrs)
{
scope.$watch(true, function(v)
{
elm.hide();
});
scope.$watch(scope.isLoading, function (v)
{
if(v){
elm.show();
}else{
elm.hide();
}
});
}
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment