voltrb - Getting access to a ModelController -


i trying interface youtube player api. works fine. however, api lets define callbacks fired whenever, instance, video has finished playing. call modelcontroller action @ time. how can access actions on modelcontroller within native js? opal.volt.??? ?

[question copied gitter]

on accessing model controller. want set callback inside of controller. in opal can use proc (not block) callback (since can used in place of js function) inside of proc, call whatever want on modelcontroller. can convert method into

module main   class maincontroller < volt::modelcontroller     def index       callback = proc {|*args| some_method(*args) }       `youtube.somehandler(callback);`     end   end end 

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -