Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
fix(directive): change event for listening to $translateChangeEnd
Browse files Browse the repository at this point in the history
Under some circumstances, the cloak was not be removed:
* the translations are already stored (not via custom loader)
* no customer loader defined anyway

This changes the listening event to the change-end phase, which will be
invoked always.

Fixes #658
  • Loading branch information
knalli authored and 0x-r4bbit committed Aug 3, 2014
1 parent ed6023a commit 98fe649
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/directive/translate-cloak.js
Expand Up @@ -19,7 +19,7 @@ angular.module('pascalprecht.translate')

return {
compile: function (tElement) {
$rootScope.$on('$translateLoadingSuccess', function () {
$rootScope.$on('$translateChangeEnd', function () {
tElement.removeClass($translate.cloakClassName());
});
tElement.addClass($translate.cloakClassName());
Expand Down

1 comment on commit 98fe649

@ramseyfeng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.