schartier / angular-farbtastic

Angular.js directive version of the farbtastic color picker
http://sebastien.chartier.pro/angular-farbtastic/
GNU General Public License v2.0
13 stars 7 forks source link

farbtastic with angularjs and jqlot #2

Open Masrours opened 10 years ago

Masrours commented 10 years ago

Hello, I'm trying to use your plugin with angularjs and jqlite ,unfortunately it doesn't work I get always this error "Error: this.$container.html(...).find(...).attr(...).css(...).end is not a function" I don't know if it is compatibility problem with jqlite I would be very obliged if you would look into this

schartier commented 10 years ago

Please provide more information, according to jqlite documentation, functions: html, find, attr and css seems to be part of jqlite...

https://code.google.com/p/jqlite/wiki/UsingJQLite

robert-blankenship commented 9 years ago

Hey there @Masrours , I actually had the same problem!

What you need to do is ensure that jQuery is loaded before AngularJS, and that jQuery is run in "no conflict" mode:

//The top of the file angular-farbtastic.js
jQuery.noConflict();
(function($) {
    var Farbtastic = function($container, callback, options) {
        var self = this;

        this.options = $.extend({
            width: 300,
        // ...
        // ...
        // ...
}(jQuery); // last line of code in angular-farbtastic.js
robert-blankenship commented 9 years ago

Also, @schartier , the bug is caused by $object.end() not being a function. Looks like you are correct in that the rest of the functions are in the jQlite prototype