Skip to content

trigger 触发的是所有实例上的on绑定么? #17

Description

@airyland

demo在此:http://spmjs.io/docs/arale-events-test/examples/index.html

seajs.use('arale-events-test/1.0.0/index', function(araleEventsTest) {

    function a(){
    };

    araleEventsTest.mixTo(a);

    a.prototype.say = function(){
        this.trigger('say');
    };

    var b1 = new a();
    b1.on('say',function(){
        console.log('b1 says');
    });

    var b2 = new a();
    b2.on('say',function(){
        console.log('b2 says');
    });

    b2.say();
   //b1 says
   //b2 says 

});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions