I'm not sure how to do this directly using AngularJS, but you can configure the display to be both a greeting and an input and animate the opacity using the directive after loading them.
I would do it like this. 2 Guidelines for fading in content and fading when you click a link. The directive for fadeouts can simply animate an item with a unique identifier or call a service that broadcasts fadeout
Template:
<div class="tmplWrapper" onLoadFadeIn> <a href="somewhere/else" fadeOut> </div>
directives:
angular .directive('onLoadFadeIn', ['Fading', function('Fading') { return function(scope, element, attrs) { $(element).animate(...); scope.$on('fading', function() { $(element).animate(...); }); } }]) .directive('fadeOut', function() { return function(scope, element, attrs) { element.bind('fadeOut', function(e) { Fading.fadeOut(e.target); }); } });
Services:
angular.factory('Fading', function() { var news; news.setActiveUnit = function() { $rootScope.$broadcast('fadeOut'); }; return news; })
I just compiled this code quickly so that there could be some errors :)
F Lekschas Oct 26 '12 at 13:21 2012-10-26 13:21
source share