Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module("fb_totem")
- .controller('mycontroller', function($scope){
- $scope.loading=true;
- $scope.ImgLoaded=function(val){
- $scope.loading=false;
- }
- })
- <img image-on-load="ImgLoaded" ngf-humbnail="url_mobilePhoto"/>
- <button type="button" ng-click="cancel()" ng-disabled="loading"</button>
- angular.module("fb_totem")
- .directive('imageOnLoad', function() {
- return {
- restrict: 'A',
- link: function(scope, element, attrs) {
- element.bind('load', function() {
- scope.$apply(attrs.imageOnLoad)(true);
- });
- element.bind('error', function(){
- scope.$apply(attrs.imageOnLoad)(false);
- });
- }
- };
- })
Add Comment
Please, Sign In to add comment