Hi Dylan!
On Sat, Jun 23, 2012 at 7:06 AM, dylst <
dy...@subvertical.com> wrote:
> I'm also in a ng-repeat directive, so I was hoping I'd be able to include
> dynamically based off of a bound value.
> In this example, {{foo.bar}} would return "text":
> <div ng-include src="'/assets/something_{{foo.bar}}.html'"></div>
Try this:
<div ng-include src="'/assets/something_' + foo.bar + '.html'"></div>
here is the example in jsFiddle:
http://jsfiddle.net/pkozlowski_opensource/gxneq/2/
> The first example above works, but the second doesn't. Is the ng-include
> firing before the interpolation happens?
> I tried a bunch of different quoting scheme's, but nothing seemed to work.
The bottom line is that you shouldn't use curly braces in angular
expressions (
http://docs.angularjs.org/guide/expression). It is
helpfull to think about those expressions as JS expressions (althought
there are differences).
Hope this helps,
Pawel