Angular JS/UI: Typeahead error

783 views
Skip to first unread message

Andrew Chang

unread,
May 3, 2013, 12:34:51 PM5/3/13
to ang...@googlegroups.com
Hi,

I am new to Angular JS/UI.  I recently updated my angular js and angular ui to the latest versions.  I am now getting an error when I am creating an input with a typeahead dynamically of:

Error: Failed to load template: template/typeahead/typeahead.html

I tried reproducing this in plunkr but I am unable to.  I am doing something similar to this though (I am not getting the error in my plunkr):


Any advice would be greatly appreciated.

Thanks,
Andy

Pawel Kozlowski

unread,
May 3, 2013, 1:02:36 PM5/3/13
to ang...@googlegroups.com
Hi!

Hard to say without seeing the reproduce scenario but I presume that
you are including a distribution file that doesn't have templates
bundled.

Guessing that you are referencing:

http://angular-ui.github.io/bootstrap/ui-bootstrap-0.3.0.js

instead of:

http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.3.0.js

But this is just a wild guess based on your pb description.
BTW: different distribution files and their role are described here:

https://github.com/angular-ui/bootstrap/tree/gh-pages#build-files

Hope this helps,
Pawel
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to angular+u...@googlegroups.com.
> To post to this group, send email to ang...@googlegroups.com.
> Visit this group at http://groups.google.com/group/angular?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
AngularJS book:
http://www.packtpub.com/angularjs-web-application-development/book
Looking for bootstrap-based widget library for AngularJS?
http://angular-ui.github.com/bootstrap/

Andrew Chang

unread,
May 3, 2013, 2:30:45 PM5/3/13
to ang...@googlegroups.com
Hi, 

Unfortunately I am using the tpls and I am still getting the error but I am still unable to reproduce in plunkr.  Thanks for the reply, I will continue trying!

Thanks,
Andy
Message has been deleted

coderazzi coderazzi

unread,
Jun 4, 2013, 9:44:43 PM6/4/13
to ang...@googlegroups.com
Hi,

I had the same problem; in my case, I had forget to include the module dependency:

angular.module('myModule', ['ui.bootstrap.typeahead', "template/typeahead/typeahead.html"]) . . .

This last dependency is a utility module that just includes the default typeahead template on the template cache.

Hope this helps.

Pawel Kozlowski

unread,
Jun 5, 2013, 7:13:36 AM6/5/13
to ang...@googlegroups.com
Hi!

On Thu, May 9, 2013 at 4:07 AM, Andrew Chang <ahc...@gmail.com> wrote:
> I realized that when I pulled down the angular ui from NuGet, it does not
> install a templates folder with the specified folder/file below. Is that
> normal?

We are publishing different files in the NuGet bundle, check the
description of deliverables here:
https://github.com/angular-ui/bootstrap/tree/gh-pages#build-files

> In my case, should I go to this URL and download all of the templates and
> put them in the root of my project?
> https://github.com/thierryc/bootstrap-ui-angularjs/tree/master/template

No, no need for this. Just include a file with bundled templates, ex.:
ui-bootstrap-tpls-0.3.0.js (please notice -tpls- in the file name).

Cheers,
Pawel

Pawel Kozlowski

unread,
Jun 5, 2013, 7:16:17 AM6/5/13
to ang...@googlegroups.com
Hi!

On Wed, Jun 5, 2013 at 3:44 AM, coderazzi coderazzi <code...@gmail.com> wrote:
> I had the same problem; in my case, I had forget to include the module
> dependency:
>
> angular.module('myModule', ['ui.bootstrap.typeahead',
> "template/typeahead/typeahead.html"]) . . .
>
> This last dependency is a utility module that just includes the default
> typeahead template on the template cache.

I wonder why you have decided to depend on a specific module instead
of having dependency on the 'ui.boostrap':
angular.module('myModule', ['ui.bootstrap"])

If you don't want to depend on the whole package just create a custom
build (there is a button for this on the project's home page).
Reply all
Reply to author
Forward
0 new messages