0

I came across something strange and wanted to see if anyone had the same problem. I am using Angularjs with the ng-href directive within an ng-repeat as below. The issue I encountered is that if the ng-href tag just contains the {{var}}, it will do nothing.

<li ng-repeat="app in apps">   
<a ng-href="{{app.name}}">{{app.name}}</a> <--THIS DOES NOT WORK
</li>

If I add a space (or anything else) before or after the {{var}} as illustrated below it links as expected.

<li ng-repeat="app in apps">
<!-- NOTE THE BUG? HERE ... without a leading or trailing character, this doesn't work!! -->   
<a ng-href=" {{app.name}}">{{app.name}}</a> <--THIS WORKS (added a leading space)
</li>

Am I missing something here? Is this expected functionality? A bug? I tested in Chrome and Firefox with the same result...

Jason
  • 31
  • 6
  • What are the contents of {{app.name}} does it contain a fully qualified URL beginning with http(s)? – Jesse Carter Jul 17 '15 at 00:24
  • Which version of angular causes this issue.? I cant seem to replicate. http://plnkr.co/edit/K0ESzz?p=preview i dont think the issue mentioned in the thread is what you have – PSL Jul 17 '15 at 02:00
  • I am using 1.3.15... – Jason Jul 19 '15 at 14:05

1 Answers1

1

There seem to be a ticket about this bug. The ticket contains some workarounds and fixes.

  • 1
    Ah...OK I am glad I am not crazy. Thanks! The workarounds are great...adding the space seems to work as well (it is ignored). – Jason Jul 17 '15 at 00:28