I would like to ask a question about this code. BTW I understand the frustration in the question but your answer was very good. I am adapting the code and the return from the server is an object with an ID and a text portion. The async version of this code saves the text portion to asyncSelected. I need it to save the complete object so that I can retrieve the ID of the selected object. How do I do that?
Thanks On Wednesday, May 8, 2013 4:45:29 PM UTC-4, Pawel Kozlowski wrote: > > Hi! > > So, first of all, I'm the one who checked-in this horrible code that > give you headaches :-) > > On Wed, May 8, 2013 at 9:54 PM, jspeaks <[email protected] <javascript:>> > wrote: > > I am trying to work through an implementation of ui.bootstrap typeahead > and > > the code does a filter:$viewValue. I assume it is the value of the > current > > control, but is where is that document? > > So, this is the value that is entered by a user. It is exposed by a > directive to expressions so people can use this value to filter > results based on a value entered by a user. This way you can use > build-in filters (filter:$viewValue), call functions > (getResults($viewValue)) etc. > > In short: this is a variable exposed by a directive in an expression > that returns results based on a value entered by a user. > > > Also the example uses a syntax > > "state for state in states". Are there any docs on "for in" for > Angular? > > So, the typeahead directive models its syntax after the built-in > AngularJS "select" directive: > http://docs.angularjs.org/api/ng.directive:select > > This syntax is described in the select directive. Typeaheads are > really similar to selects so we've figured that it will be easier for > people to start with its syntax if it resembles something existing. > > > Documentation for Angular just freakin sucks right now IMHO. > > It can be intimidating, but it is getting better. It takes a bit of > time to get used to the AngularJS-way, but time taken to learn it is > well invested IMO. > > If you've got any further question will be happy to help. > Out of curiosity - what made you look into the source code? Bug > hunting? Learning? > It is not the easiest directive out there, BTW, so probably not the > best learning material. > > Hope this helps, > Pawel > > > -- > 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/ > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
