0

in an Angularjs controller i have the following function:

 function colorDropDownEditor(container, options) {
    $('<input data-text-field="Myobject" data-value-field="Referente" data-bind="value:' +    options.field + '"/>')
    .appendTo(container)
 ...
 ...

Now my question is: how angularjs can execute the jquery method? How can interpret the "$" symbol?

Thanks

Tom
  • 4,007
  • 24
  • 69
  • 105
  • 3
    Read this : http://stackoverflow.com/a/15012542/1125027. It describes how to use jQuery with AngularJS. – Sandeep Panda Jun 14 '14 at 13:30
  • You can use `$` as a variable to hold anything - it doesn't have to be _jQuery_. That said, this does look like _jQuery_ so maybe the author has assumed it – Paul S. Jun 14 '14 at 13:30
  • 1
    I'd recommend away from twisting jquery into angularjs like that. Here is a directive in angularjs for a color-picker. http://ngmodules.org/modules/ng-color-picker You'll get more power and leverage angularjs better binding with it and trying to push angular out to jquery. A directive will give you this power. – KnowHowSolutions Jun 14 '14 at 13:34

1 Answers1

2

Angular includes jqLite, which implements a subset of all jQuery functionality.

From the Angular FAQ:

Yes, Angular can use jQuery if it's present in your app when the application is being bootstrapped. If jQuery is not present in your script path, Angular falls back to its own implementation of the subset of jQuery that we call jQLite.

mb21
  • 34,845
  • 8
  • 116
  • 142