calliope icon indicating copy to clipboard operation
calliope copied to clipboard

Angular string interpolation doesn't always work correctly.

Open zonecheung opened this issue 9 years ago • 0 comments

Sometimes, when I put an angular string interpolation ( using {{ }} ) in the attribute, for example:

%textarea.form-control(id="{{ journal_entry.id }}" rows=5)

It might generate an invalid HTML like this:

<textarea id="{{" class="form-control" rows="5"></textarea>

While the expected result is like this:

<textarea class="form-control" id="420" rows="5"></textarea>''

However, it doesn't always behave like that, which is confusing, the following generates the correct result:

%a.pull-left.hidden-sm.hidden-xs(ng-hide="show_new_entry_form" ng-href="/user/{{ current_user.username }}/profile")

converted to:

<a class="pull-left hidden-sm hidden-xs" ng-hide="show_new_entry_form" ng-href="/user/helloworld/profile" href="/user/helloworld/profile"></a>

Would really appreciate if it can be fixed, otherwise we need to check our templates back and forth, and convert some lines to regular html to make it work.

TIA, ~ John

zonecheung avatar Jul 23 '15 11:07 zonecheung