ciscoheat / mithril-hx

Haxe externs for Mithril (JS MVC framework)
181 stars 12 forks source link

mitrhil-hx not working properly with mithril > 0.2.0 #25

Closed freakinruben closed 8 years ago

freakinruben commented 8 years ago

I'm not sure why, but the this scope of controllers is not being changed for controller functions when I use mithril 0.2.1 and higher.

When I pause the debugger, it seems that

    if(m.__haxecomponents.length && !$bind(this,this.controller)) {
        return m.__haxecomponents.pop().controller();
    }

m.__haxecomponents.length is 0 while with 0.2.0 it will be at least 1.

Any chance you know a fix for this?

ciscoheat commented 8 years ago

Yes, it doesn't work above 0.2.0 because of internal Mithril changes. I will wait until the next stable release, then look at what needs to be done. I hope you can use 0.2.0 for the time being.

ciscoheat commented 8 years ago

Good news, Mithril 0.2.3 has just been released and it works just fine again with mithril-hx! I'll upgrade the examples soon, but you can just download or use the latest version from a CDN if you like.