Skip to content

Instantly share code, notes, and snippets.

@taichi
Created September 14, 2011 17:42
Show Gist options
  • Save taichi/1217216 to your computer and use it in GitHub Desktop.
Save taichi/1217216 to your computer and use it in GitHub Desktop.
ClosureLibraryで特定のUIコンポーネントが受信するイベントを全部ログに出す。
goog.object.forEach(goog.ui.Component.EventType, function(type) {
goog.events.listen(reader, type, goog.bind(console.log, console, type));
});
@Kuniwak
Copy link

Kuniwak commented Feb 13, 2013

goog.bindを使わなくてもできますよ。

goog.events.listen(reader, goog.object.getValues(goog.ui.Component.EventType), function(e) {
  console.log(e);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment