Giter Site home page Giter Site logo

Comments (9)

bevacqua avatar bevacqua commented on May 20, 2024

Do you want to work on this enhancement?

from angularjs-dragula.

luckylooke avatar luckylooke commented on May 20, 2024

I can try.. I have one idea how it should be done without modifying dragula
lib itself.
On Aug 19, 2015 4:05 AM, "Nicolas Bevacqua" [email protected]
wrote:

Do you want to work on this enhancement?


Reply to this email directly or view it on GitHub
#7 (comment)
.

from angularjs-dragula.

bevacqua avatar bevacqua commented on May 20, 2024

Sounds awesome!

from angularjs-dragula.

luckylooke avatar luckylooke commented on May 20, 2024

I have one dilema... how do you wish users to provide model to sync with?

dragulaService.options(scope, name, options, model)

or?

from angularjs-dragula.

bevacqua avatar bevacqua commented on May 20, 2024

I was thinking we probably should do something like a directive dragula-model='foo', and $eval that on the dragula-scope. That way we get away from the programmatic style and more into the Angular way

from angularjs-dragula.

luckylooke avatar luckylooke commented on May 20, 2024

ok, I have also problem with drake events.. I have put listeners in setOptions, but they are not fired.. do you have idea why? I know there is replicator but there can be more than one listener right?

function setOptions (scope, name, options) {
      var bag = add(scope, name, dragula(options));
      if(model !== void 0){ // model to sync with (must have same structure as containers)
        var ctx = getOrCreateCtx(scope);
        var drake = bag.drake;
        console.log('drake', drake);
        drake.on('remove',function removeModel () {
          console.log('removeModel', arguments);
        });
        drake.on('cloned',function clonedModel () {
          console.log('clonedModel', arguments);
        });
        drake.on('drop',function dropModel () {
          console.log('dropModel', arguments);
        });
      }
    }

from angularjs-dragula.

bevacqua avatar bevacqua commented on May 20, 2024

You should be able to attach as many event listeners as you'd like. If they're not firing maybe you're attaching the events to the wrong drake?

from angularjs-dragula.

luckylooke avatar luckylooke commented on May 20, 2024

@bevacqua yes, that was the cause... I had typo in bag name ;)

from angularjs-dragula.

bevacqua avatar bevacqua commented on May 20, 2024

Awesome! Glad you're working on this

from angularjs-dragula.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.