Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Empty Template results in erroneous XHR when ngInclude is passed a function #3770

Closed
searls opened this issue Aug 27, 2013 · 0 comments
Closed

Comments

@searls
Copy link

searls commented Aug 27, 2013

Plnkr Demo

screen shot 2013-08-27 at 12 07 48

This is a pretty straightforward issue. When the template cache has an entry for a template set to empty string (""), ng-include of that template by name (e.g. ng-include="foo.html") is smart enough to tell the difference between an empty template and a non-existent one, because it won't attempt to fetch the template with an XHR.

However, if the ngInclude is used in conjunction with an expression that invokes a function (e.g. ng-include="templateFor('footer')"), an empty template will result in an XHR.

This may seem like a minor quibble, but I'm actually experiencing some extremely bizarre downstream behavior in a real application due to this (which utlimately causes Chrome to lock up because it's hitting the digest limit repeatedly).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants