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

ngRroute : Empty html template returns "Failed to load template" #9581

Closed
ramigb opened this issue Oct 13, 2014 · 6 comments
Closed

ngRroute : Empty html template returns "Failed to load template" #9581

ramigb opened this issue Oct 13, 2014 · 6 comments

Comments

@ramigb
Copy link

ramigb commented Oct 13, 2014

When i try to load an empty template -blank html page- i get the following errors "Failed to load template".

I am using version "1.3.0-rc.5", tried it on Chrome and FireFox latest builds.

@caitp
Copy link
Contributor

caitp commented Oct 13, 2014

This is a $templateRequest bug :( Sigh ._.

@caitp caitp added this to the 1.3.0 milestone Oct 13, 2014
@caitp
Copy link
Contributor

caitp commented Oct 13, 2014

Just FYI, it "should" work for you if you use template rather than templateUrl, so that's a quick fix until there's a proper fix in the tree.

@ramigb
Copy link
Author

ramigb commented Oct 13, 2014

@caitp, it's not affecting me, i just noticed it while i was working, quickly googled it couldn't find any match so i thought i'd submit it, first time submitting a bug to angularjs repo, i hope i helped 🎅

@Narretz
Copy link
Contributor

Narretz commented Oct 13, 2014

The commit (a70e283) mentions empty templates causing errors as a Breaking Change. I'd say yes, because ng-view with an empty template doesn't really make sense. The question is if that makes sense. Maybe we should just tweak the error message?

@caitp
Copy link
Contributor

caitp commented Oct 13, 2014

It's a bollocks error with no meaningful reason for existing, actually. While logging a message wouldn't be seriously harmful, some people actually find the empty template behaviour useful and it's been asked for by others, though don't ask me why.

There's no issue with element transclusion because the content fill directive is a different directive from the element transclusion issue. It's just an arbitrary "we will throw for no reason here because lol" thing.

cmichal pushed a commit to cmichal/angular.js that referenced this issue Oct 21, 2014
allow empty html template and not throw error

Closes angular#9581
cmichal added a commit to cmichal/angular.js that referenced this issue Oct 21, 2014
allow empty html template and not throw error

Closes angular#9581
cmichal added a commit to cmichal/angular.js that referenced this issue Oct 21, 2014
allow empty html template and not throw error

Closes angular#9581
cmichal added a commit to cmichal/angular.js that referenced this issue Oct 21, 2014
allow empty html template and not throw error

Closes angular#9581
@amrnt
Copy link

amrnt commented Oct 21, 2014

kudos @ramigb 💃

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

Successfully merging a pull request may close this issue.

4 participants