Created
December 7, 2013 16:06
-
-
Save Cengizism/937aa4df6f5998306501 to your computer and use it in GitHub Desktop.
change route 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
'use strict'; | |
var directives = angular.module('guthub.directives', []); | |
directives.directive('butterbar', ['$rootScope', | |
function($rootScope) { | |
return { | |
link: function(scope, element, attrs) { | |
element.addClass('hide'); | |
$rootScope.$on('$routeChangeStart', function() { | |
element.removeClass('hide'); | |
}); | |
$rootScope.$on('$routeChangeSuccess', function() { | |
element.addClass('hide'); | |
}); | |
} | |
}; | |
}]); | |
directives.directive('focus', | |
function() { | |
return { | |
link: function(scope, element, attrs) { | |
element[0].focus(); | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment