How do i apply holder.js in ionic?


#1

Greetings,

in Bootstrap, i can use holder.js <img data-src="js/holder.js/64x64">.
but ionic, How do i apply holder.js?

p.s.

i tried <img ng-src="js/holder.js/64x64>, but does not work.


#2

Hm, seems this that holder.js doesn’t work right out of the box, you need to fix this.

app.directive('holderFix', function () {
    return {
        link: function (scope, element, attrs) {
            Holder.run({ images: element[0], nocss: true });
        }
    };
});

And then use it like this

<img data-src="holder.js/300x200" holder-fix>
<img src="holder.js/300x200" holder-fix>

#3

Thank you so much, i can keep my layout use holder.js