Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
fix(code): add angular-array-notation to survive code uglify
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Burgmer committed Jul 2, 2014
1 parent c5633ce commit d81b9ed
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/js/w11k-flash.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
angular.module('w11k.flash', []);

// register swfobject as service to be able to mock it
angular.module('w11k.flash').factory('swfobject', function ($window) {
angular.module('w11k.flash').factory('swfobject', ['$window', function ($window) {
return $window.swfobject;
});
}]);

angular.module('w11k.flash').factory('w11kFlashRegistry', function () {
angular.module('w11k.flash').factory('w11kFlashRegistry', [function () {
var flashIdPrefix = 'w11k-flash-id-';
var flashIdCounter = 0;
var flashMap = {};
Expand All @@ -26,9 +26,9 @@ angular.module('w11k.flash').factory('w11kFlashRegistry', function () {
return flashMap[flashId];
}
};
});
}]);

angular.module('w11k.flash').run(function ($window, w11kFlashRegistry) {
angular.module('w11k.flash').run(['$window', 'w11kFlashRegistry', function ($window, w11kFlashRegistry) {
if (angular.isFunction($window.w11kFlashIsReady) === false) {
$window.w11kFlashIsReady = function (flashId) {
var flash = w11kFlashRegistry.getFlash(flashId);
Expand All @@ -40,9 +40,9 @@ angular.module('w11k.flash').run(function ($window, w11kFlashRegistry) {
}
};
}
});
}]);

angular.module('w11k.flash').run(function ($window, w11kFlashRegistry) {
angular.module('w11k.flash').run(['$window', 'w11kFlashRegistry', function ($window, w11kFlashRegistry) {
if (angular.isFunction($window.w11kFlashCall) === false) {
$window.w11kFlashCall = function (flashId, expression, locals) {
var flash = w11kFlashRegistry.getFlash(flashId);
Expand All @@ -52,7 +52,8 @@ angular.module('w11k.flash').run(function ($window, w11kFlashRegistry) {
// we have to evaluate the expression outside of the apply function,
// otherwise we are unable to return the result to flash
var result = scope.$eval(expression, locals);
scope.$apply(function () { });
scope.$apply(function () {
});

return result;
}
Expand All @@ -61,7 +62,7 @@ angular.module('w11k.flash').run(function ($window, w11kFlashRegistry) {
}
};
}
});
}]);

// extract config from directive and define overridable defaults
angular.module('w11k.flash').constant('w11kFlashConfig', {
Expand All @@ -73,7 +74,7 @@ angular.module('w11k.flash').constant('w11kFlashConfig', {
}
});

angular.module('w11k.flash').directive('w11kFlash', function (swfobject, $window, $q, w11kFlashConfig, $timeout, w11kFlashRegistry) {
angular.module('w11k.flash').directive('w11kFlash', ['swfobject', '$window', '$q', 'w11kFlashConfig', '$timeout', 'w11kFlashRegistry', function (swfobject, $window, $q, w11kFlashConfig, $timeout, w11kFlashRegistry) {
var deepMerge = function (destination, source) {
for (var property in source) {
if (source[property] && source[property].constructor && source[property].constructor === Object) {
Expand Down Expand Up @@ -161,8 +162,8 @@ angular.module('w11k.flash').directive('w11kFlash', function (swfobject, $window

swfobject.embedSWF(config.swfUrl,
flashId,
'' + config.width,
'' + config.height,
'' + config.width,
'' + config.height,
config.minFlashVersion,
false,
config.flashvars,
Expand All @@ -173,4 +174,4 @@ angular.module('w11k.flash').directive('w11kFlash', function (swfobject, $window
};
}
};
});
}]);

0 comments on commit d81b9ed

Please sign in to comment.