Hi all
Been trying to get my own autocomplete plugin to work as an Angular
directive
Hopefully this is a straightforward one, please let me know if I'm barking
up the wrong tree with this.
So I have a jquery autocomplete plugin that I wrote myself, just trying to
hook it up in Angular as a directive, purely to have a play with my own
directives.
The bit I'm struggling with is passing the content of the text box to the
api endpoint. If you look in the demo and in the console, you'll see it is
passing undefined across each time (line 133 and 173 in jsfiddle).
scope.testAutocomplete = new AA('Test', element,{
dataType: 'json',
jsonPath: 'http://apiendpoint.com?query=' + scope.searchTerm +
'&apikey=1234&limit=5'
The 'watch' inside the directive updates correctly, but it passes
'undefined' to the endpoint.
apologies for the fiddle, Plunkr just won't save for some reason.
http://fiddle.jshell.net/PxHC3/7/show/http://jsfiddle.net/PxHC3/7/
I created a jsonPath variable which I am trying to update on watch. But it
just outputs blank: fiddle.jshell.net/PxHC3/9/show
So before I even get to passing info into scopes and such, I'm just
wondering if I'm on the right path.
Cheers Tom
--
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.