Last active
August 29, 2015 14:00
-
-
Save Igosuki/5baa748f2e0040c547fe to your computer and use it in GitHub Desktop.
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
var kittens = angular.module("ngKitten", []); | |
kittens.directive('kittens', function factory() { | |
var kittensDirective = { | |
restrict: 'AC', | |
scope: false, | |
compile: function compile(tElement, tAttrs, transclude) { | |
return { | |
pre: function preLink(scope, element, attrs) { | |
element.attr('ng-src', 'http://placekitten.com/'+element.attr('width')+'/'+element.attr('height'); | |
} | |
} | |
}, | |
}; | |
return kittensDirective; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment