define([
    'jquery',
    'angular'
], function($, angular) {
    'use strict';

        /**
         * Gives top shadow for scroll elements
         *
         * Usage:
         * <div sd-shadow></div>
         *
         */
        return [ '$timeout', function($timeout) {
            return {
                link: function(scope, element, attrs) {

                    $timeout(function() {
                        var el = $(element);
                        var shadow = $('<div class="scroll-shadow"></div>');
                        shadow.css({
                                top: el.offset().top,
                                left: el.offset().left,
                                width: el.outerWidth()
                            });
                        $('body').append(shadow);

                        el.scroll(function() {
                            if ($(this).scrollTop() > 0) {
                                shadow.addClass('shadow');
                            } else {
                                shadow.removeClass('shadow');
                            }
                        });
                    }, 500);
                }
            };
        }];
});

@@ -508,24 +508,120 @@
 %22%3E%3C/div%3E');%0A
+%0A                        el.append(shadow);%0A%0A                        el.scroll(function() %7B%0A    
             
@@ -846,106 +846,8 @@
 %7D);%0A
-                        $('body').append(shadow);%0A%0A                        el.scroll(function() %7B%0A
     

Update shadow directive