Allow passing scope variable directly to directive#141
Allow passing scope variable directly to directive#141gabegorelick wants to merge 1 commit intorubenv:masterfrom
Conversation
E.g. `<div translate="message"></div>`
|
I'm not sure this is a good idea: users of Jade will be bitten by it. The following piece of Jade: span(translate) TestTranslates to: <span translate="translate">Test</span>There's little reason to have this syntax as an alternative to the normal version (unless I'm missing something). In those cases I prefer to have 1 good way of doing things rather than two equivalent options. More options are just plain confusing and add little value. |
|
Well it solves some of the issues brought up in #72. And it also might be useful to pass an options object to the directive, e.g. Although this isn't implemented anywhere yet, since that could make extraction difficult to say the least. A lot of directives use this convention, so there must be a way to make it work with things like Jade. |
As a general rule I don't believe theories about performance unless it's backed up by numbers. Unless we can show that it's truly problematic (and I expect it to be negligible), it's probably best to focus on stuff that actually matters. #72 should probably just be closed as invalid. |
|
Not the performance issues, which are un-tested, just some of the convenience and flickering issues. You can make a case for fixing those without the need for hard numbers. |
|
Is it our task to fix that? I mean, You could even solve this right now, without any changes to angular-gettext:
translate, [translate] {
visibility: hidden;
}
body.loaded translate, body.loaded [translate] {
visibility: inherit;
}This hides all strings until the app is initialized, but keeps their sizing intact. This is actually much more desirable than |
I don't have a strong opinion one way or the other. I'm honestly more interested in whether passing a config object directly on the translate attribute would be worthwhile. I just threw this together to get started and see if it solves some of #72. |
E.g.
<div translate="message"></div>Work in progress.