Repository navigation
translate directive along with other transclude directive #132
Description
Activity
Is this supposed to work somehow? or I must to put translate on another inner tag:
I believe so, since the translate directive has default priority of 0 and is terminal. You can read up on directive priorities and terminal here.
Like you mentioned, wrapping the string in a span is usually what you want to do.
I'm still trying to avoid the inner
<span>if this is possible.
Is there a reason thetranslatedirective has to haveterminal: true?I my case I need
translatedirective to run first and then mydemodirective. But that's not possible iftranslatehasterminal: true.This isn't caused because of
terminal: true. Having it in place makes directives at different priorities possible.I my case I need translate directive to run first and then my demo directive. But that's not possible if translate has terminal: true.
Check the docs link mentioned by @gabegorelick, you might want to look into directive priorities.
Actually, I believe it is caused by terminal. Terminal says to not execute
directives at lower priority, which appears to be the issue the poster is
complaining about.That being said, I still think limiting other directives on the translate
element is the way to go because otherwise the ordering can get confusing.
It's best to wrap it in a span.On Tuesday, November 25, 2014, Ruben Vermeersch notifications@github.com
wrote:This isn't caused because of terminal: true. Having it in place makes
directives at different priorities possible.I my case I need translate directive to run first and then my demo
directive. But that's not possible if translate has terminal: true.Check the docs link mentioned by @gabegorelick
https://github.com/gabegorelick, you might want to look into directive
priorities.—
Reply to this email directly or view it on GitHub
#132 (comment)
.Actually, I believe it is caused by terminal. Terminal says to not execute
directives at lower priority, which appears to be the issue the poster is
complaining about.I checked things again and yes, you are right. We used to have the double-directive trick that's also used by
ngView. Nowadays it seems we only use one directive. We can probably get rid ofterminal, but it won't fix the issue at hand.We could set the translate directive at a different priority. But should it
be higher priority or lower? Again, probably best to keep it as is and just
make people wrap it in a span for clarity.On Tuesday, November 25, 2014, Ruben Vermeersch notifications@github.com
wrote:Actually, I believe it is caused by terminal. Terminal says to not execute
directives at lower priority, which appears to be the issue the poster is
complaining about.I checked things again and yes, you are right. We used to have the
double-directive trick that's also used by ngView. Nowadays it seems we
only use one directive. We can probably get rid of terminal, but it won't
fix the issue at hand.—
Reply to this email directly or view it on GitHub
#132 (comment)
.We could set the translate directive at a different priority.
Not without breaking compatibility: people might be depending on the existing behavior.
I too recommend just throwing a span in there. Happens in a gazillion other places as well in Angular.JS.
Yeah the compatibly goes without saying :)
On Tuesday, November 25, 2014, Ruben Vermeersch notifications@github.com
wrote:We could set the translate directive at a different priority.
Not without breaking compatibility: people might be depending on the
existing behavior.I too recommend just throwing a span in there. Happens in a gazillion
other places as well in Angular.JS.—
Reply to this email directly or view it on GitHub
#132 (comment)
.- added a commit that references this issue
on Dec 8, 2014 #147 makes the directive non-terminal. That should fix some of the issues brought up in this bug report. But in general
<span>is your friend.- added a commit that references this issue
on Dec 8, 2014
I'm using the
translatedirective on a tag that also has another transclude directive:(JavaScript was automatically generated from CoffeeScript with ng-classify:
)
Setting
demodirective's priority to -1000 translatesSome textbut replaced the demo's template entirely.Is this supposed to work somehow? or I must to put
translateon another inner tag: