Skip to content

Error when used as directive on angular-ui alert #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
varadero opened this issue Oct 5, 2015 · 2 comments
Closed

Error when used as directive on angular-ui alert #224

varadero opened this issue Oct 5, 2015 · 2 comments

Comments

@varadero
Copy link

varadero commented Oct 5, 2015

I'm using angular 1.3.9, angular-ui-bootstrap 0.12.0 and angular-gettext 2.1.0.

If you use translate directive to angular-ui-bootstrap alert like this:

<alert type="danger" translate>Login failed: {{vm.data.loginFailDescription}}</alert>

you get the following error

Error: [ngTransclude:orphan] Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: <div ng-transclude="">
http://errors.angularjs.org/1.3.9/ngTransclude/orphan?p0=%3Cdiv%20ng-transclude%3D%22%22%3E
   at link (http://localhost:29471/vendor/angular/angular.js:25109:7)
   at invokeLinkFn (http://localhost:29471/vendor/angular/angular.js:8213:9)
   at nodeLinkFn (http://localhost:29471/vendor/angular/angular.js:7722:11)
   at compositeLinkFn (http://localhost:29471/vendor/angular/angular.js:7075:13)
   at publicLinkFn (http://localhost:29471/vendor/angular/angular.js:6954:30)
   at update (http://localhost:29471/vendor/angular/angular-gettext.js:210:25)
   at post (http://localhost:29471/vendor/angular/angular-gettext.js:223:21)
   at invokeLinkFn (http://localhost:29471/vendor/angular/angular.js:8213:9)
   at nodeLinkFn (http://localhost:29471/vendor/angular/angular.js:7722:11)
   at delayedNodeLinkFn (http://localhost:29471/vendor/angular/angula

@varadero
Copy link
Author

varadero commented Oct 5, 2015

I just want to note a workaround - removing translate directive from alert itself and wrapping translatable content inside <span translate> like this:

<alert type="danger"><span translate>Login failed: {{vm.data.loginFailDescription}}</span></alert>

@varadero
Copy link
Author

varadero commented Oct 6, 2015

It seems that it is caused because <alert> template contains transcluded part as described in #132 where the suggestion is to wrap translatable content inside <span> so I will close that issue.

@varadero varadero closed this as completed Oct 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant