Skip to content

Instantly share code, notes, and snippets.

@chanakaDe
Created May 24, 2016 10:39
Show Gist options
  • Save chanakaDe/c2183a7ff5ad45d438b75ba6e9fa1450 to your computer and use it in GitHub Desktop.
Save chanakaDe/c2183a7ff5ad45d438b75ba6e9fa1450 to your computer and use it in GitHub Desktop.
app.directive('img', ->
# restrict: 'A'
link: (scope, iterStartElement, attr, element) ->
`function getImages(name) {
var images = document.getElementsByTagName('img');
console.log("Demo name", name);
console.log("IMAGE LENGTH : ", images.length);
console.log(images);
var i;
for (i = 0; i < images.length; i++) {
console.log("IMAGE : ", images[i].src);
images[i].src = 'http://steam.realss.com/realss/website' + images[i].src;
}
console.log("IMAGE LENGTH LAST : ", images.length);
}`
getImages "img"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment