Hi,
Usually when building a full Angular app, it is best to keep everything in
the "Angular world". Only use 3rd party components in directives. And yes,
if you do use an isolate scope with a '=' binding it will become a two-way
binding to which you will have access through the scope.
I'm afraid I'm not able to clarify your particular issue due to the fact
that I have no idea what Select2 is. But if you would post some code (or
links to it), I'm sure you will get a lot more answers.
Cheers!
Gabriel
On Tuesday, 22 April 2014 22:10:09 UTC+1, alycklama wrote:
>
> I created a wrapper around the Select2 library for autocompletion and so
> far everything works great! The only thing that I'm wondering is this:
> - How do I get the selected value / values back to Angular??
>
> In the link function I would need to call to method below to get the value:
>
> element("val")
>
> There are two concepts that I don't understand currently:
> - How do I retrieve the ng-model variable within my own directive? Or is
> it just as simple as adding this to the scope?
>
> ngModel: '='
>
> - How do I make dual binding work with external javascript components?
> (E.g. the Select2 library that I'm currently using) since I don't think I
> will be able to use a $watch on anything outside of Angular.
>
--
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.