Solve the UI Bootstrap modal error: Failed to load template

Are you getting the following error when attempting to use a UI Bootstrap modal dialog in your AngularJS project?

Failed to load template: template/modal/backdrop.html

Make sure you're linking to the UI Bootstrap library with the templates included (i.e. ui-bootstrap-tpls.js) and not the plain UI Bootstrap library (i.e. ui-bootstrap.js).

<script src="//"></script>
Thomas May 7, 2014

Saved my day :)

Stoyan Jun 4, 2014

Thanks! :)

Rich Aug 15, 2014

Thanks a bunch, dude!

Ben Aug 19, 2014

Thanks! this was really good to know as a noob starting angular development!

Ibrahim Islam Sep 10, 2014

You just helped me sleep early

Lise Sep 11, 2014

Thanx - this was exactly what I needed to make my modal work.

Chase Oct 2, 2014


Adam Nov 5, 2014

I can't believe this isn't the default answer for:$compile/tpload?p0=template%2Fmodal%2Fwindow.html

Although it appears I can't write an answer based on the template variable name.

Adam Nov 5, 2014

And default answer for:$compile/tpload?p0=template%2Fmodal%2Fbackdrop.html

(adding it here for SEO purposes)

John Dec 1, 2014

You saved another dev today, thank you!

Mustafa Dec 2, 2014

THank you!

Hari Dec 4, 2014

Thank you very much! I didn't understand the error message at all! :D

Josh Dec 17, 2014

This tip saved me at least an hour!

Max Feb 15, 2015

Thanks. I wish this was a little more clean on the documentation.

Cedric Mar 6, 2015

You the man!!!

Samuel Zuniga Vanoye Mar 7, 2015

Thanks, you saved me a lot of time.

Darkiano Terrorino Mar 24, 2015

You're awesome!
Thank you Sir!

Muhammad Junaid Mar 31, 2015

Thanks, you saved my day, keep it up man :)

Diego Unanue Mar 31, 2015

Thanks u very much, u save me a lot of time!

colin Apr 12, 2015

perfect. Worked :-)

Steve May 7, 2015

This saved me too!!! Thanks

Víctor Vargas May 11, 2015

Thanks!!! :D

Paul May 14, 2015

Best! :)

Gerry May 14, 2015

Super helpful! I ran into the issue where having both the files loaded stops the dropdowns. Same thing if you only use the tpls file and exclude the ui-bootstrap file. Anyone else getting something similar?

Jay Jun 26, 2015

Great!! Thanks for this.

Vishal Jul 7, 2015

Perfect (y)

Tendai Jul 9, 2015

I'm a bit disgusted that the answer on angularjs is totally unclear. Thanks a million man. I can't help to look around the site for other tips already ;)

bohado Aug 5, 2015

Thanks! Save me with ONE sentence!

Rupal Sep 18, 2015

I wonder how did they fail to mention this in the document.

Thanks a lot!

Cristhian Castañeda Sep 22, 2015

Thanks man .!!

Allinson Oct 15, 2015

Solved my issue!!!

Igor Oct 26, 2015

Thanks man!

Diane Nov 2, 2015

Thanks for this.

Spencer Dec 9, 2015

Thank you !!!

Andreas Dec 16, 2015

Gracias amigo.

Kai Dec 20, 2015

Saved me hours

Craig Jan 9, 2016

Thank you for leaving this; it saved me so much time of digging and debugging, not to mention frustration.

Jennifer Cui Jan 21, 2016

Omg. This saved my day. Thank you!

vijay reddy gudi Jan 22, 2016

This helped me.. Thanks a ton.

mikelowry Feb 9, 2016

Thank you for your post!!!!!!!!!!!

Maxim Feb 17, 2016

Thank you! This helps me!

Alex Feb 17, 2016

Gracias!! Me Sirvió de maravilla :D

Scrum Taco Feb 23, 2016

I love you. Thanks

Thomas Kanzig Mar 18, 2016

OOhh yeeeees, Thank you so much =D

Chris Wood Apr 22, 2016

And another dev saved, thank you

Phil May 11, 2016

Woot! 3 hours wasted, could have been another day.

Luis F Rocha Jun 1, 2016


Arun Jul 23, 2016

Thank you saved my time

Baggio Sep 4, 2016

Lifesaver...thank you so much!

Deter Sep 22, 2016

Ouuuh yeah thank you !!!

Rob Baartwijk Oct 28, 2016

Now THAT is what I call a clear solution to an opaque problem! Thank you, that saved me a lot of time.

Pierre Nov 21, 2016

A huge thank you!

Michael Dec 1, 2016

Thanks a lot!!! :)

Michel Jan 1, 2017

Tnx it works! Happy new year :D

Fettabachi Feb 1, 2017

The solution is cleverly hidden on this page;

w2way Mar 21, 2017

Best solution

Tejas Mar 30, 2017

thank you very much

Madhav Jun 19, 2017


Alexey Aug 28, 2017

Thank you. Save my day

Leave a Comment