// (function() {
//     angular
//         .module('appMessage')
//         .directive('imgLoad', imgLoad);
//     imgLoad.inject = ['$parse', '$rootScope'];

//     function imgLoad($parse, $rootScope) {
//         var directive = {
//             compile: compile,
//             restrict: 'A'
//         };
//         return directive;

//         function compile($element, attr) {
//             var fn = $parse(attr['img-load'], null, true);
//             return function ngEventHandler(scope, element) {
//                 element.on('load', function(event) {
//                     var callback = function() {
//                         console.log('sssssssss');
//                         fn(scope, {
//                             $event: event
//                         });
//                     };
//                     scope.$apply(callback);
//                 });
//             };
//         }
//     }
// })();


// (function() {
//     angular
//         .module('appMessage')
//         .directive('imgError', imgError);

//     imgError.inject = ['$parse', '$rootScope'];

//     function imgError($parse, $rootScope) {
//         var directive = {
//             compile: compile,
//             restrict: 'A'
//         };
//         return directive;

//         function compile($element, attr) {
//             var fn = $parse(attr['img-error'], null, true);
//             return function ngEventHandler(scope, element) {
//                 element.on('error', function(event) {
//                     var callback = function() {
//                         fn(scope, {
//                             $event: event
//                         });
//                     };
//                     scope.$apply(callback);
//                 });
//             };
//         }
//     }
// })();

/*
 * A collection of directives that allows creation of custom event handlers that are defined as
 * angular expressions and are compiled and executed within the current scope.
 */
// var ngEventDirectives = {};

// For events that might fire synchronously during DOM manipulation
// we need to execute their event handlers asynchronously using $evalAsync,
// so that they are not executed in an inconsistent state.
// var forceAsyncEvents = {
//   'blur': true,
//   'focus': true
// };
// forEach(
//   'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),
//   function(eventName) {
//     var directiveName = directiveNormalize('ng-' + eventName);
//     ngEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) {
//       return {
//         restrict: 'A',
//         compile: function($element, attr) {
//           // NOTE:
//           // We expose the powerful `$event` object on the scope that provides access to the Window,
//           // etc. This is OK, because expressions are not sandboxed any more (and the expression
//           // sandbox was never meant to be a security feature anyway).
//           var fn = $parse(attr[directiveName]);
//           return function ngEventHandler(scope, element) {
//             element.on(eventName, function(event) {
//               var callback = function() {
//                 fn(scope, {$event: event});
//               };
//               if (forceAsyncEvents[eventName] && $rootScope.$$phase) {
//                 scope.$evalAsync(callback);
//               } else {
//                 scope.$apply(callback);
//               }
//             });
//           };
//         }
//       };
//     }];
//   }
// );