Some help using Angular with Twitter Typeahead.js + understanding angular templates

627 views
Skip to first unread message

Ramin Bozorgzadeh

unread,
Jun 2, 2013, 8:45:52 PM6/2/13
to ang...@googlegroups.com
Hey everyone,

I am new to Angular and learning (and liking) it so far. I am currently trying to integrate twitter's typeahead.js library while using angular js as the templating mechanism.

If you are unfamiliar with typeahead.js, it is a standalone autocomplete library that the twitter engineer team has created that has support for basic typeahead and autocomplete features with custom templating of results.

The documentation recommends using Hogan.js (another twitter project) as the template engine, but any template engine that adheres to their API will work. The engine needs to simply have a "compile" function that returns a compiled template object, which in turn has a "render" function that spits out the rendered result.

Ok, now that we have that all that information, what I am trying to do is utilize this typeahead library, but use AngularJS as the template engine. I've been able to use the $templateCache to load up an angular ngScript template and pass it to the typeahead library .. however, I am having a hard time getting it to render on the page and have the template maintain its "angular features" ... like the bindings and whatnot.

I have created a Stackoverflow question with some sample code to illustrate the problem. Any help would be greatly appreciated.


I guess another way to ask this question is ... how do you compile a custom template using ngScript and then append it to the DOM using angular, meanwhile having it maintain its bindings.

Thank you,
Ramin

paramaw

unread,
Jul 27, 2013, 2:28:34 AM7/27/13
to ang...@googlegroups.com
Hi Ramin,

Were you able to solve this issue? I'm currently looking for a solution for this as well.

--Parama
Reply all
Reply to author
Forward
Message has been deleted
0 new messages