-
Notifications
You must be signed in to change notification settings - Fork 153
Open
Description
If I have the translate keyword on an empty item (in this case a div)
<div translate>
</div>
I get the following error:
TypeError: element.parent is not a function
at queueAnimation (http://localhost:8100/lib/ionic/js/ionic.bundle.js:43785:26)
at Object.push (http://localhost:8100/lib/ionic/js/ionic.bundle.js:43737:16)
at Object.enter (http://localhost:8100/lib/ionic/js/ionic.bundle.js:18494:31)
at update (http://localhost:8100/lib/angular-gettext/dist/angular-gettext.js:223:34)
at post (http://localhost:8100/lib/angular-gettext/dist/angular-gettext.js:233:21)
at invokeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:21963:9)
at nodeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:21463:11)
at compositeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20854:13)
at compositeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20858:13)
at nodeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:21458:24) <div translate="">
Seems like the contents() function on angular-gettext.js:221
var newContents = newWrapper.contents();
strips away the span of the element created on angular-gettext.js:219 if the span is empty (the translation is empty).
One (not very elegant) workaround is to add a space when creating the span element, which is then treated as not empty:
var newWrapper = angular.element('<span> ' + translated + '</span>');
Metadata
Metadata
Assignees
Labels
No labels