Ember .observe() returns callback twice when used with query-params
问题 http://jsbin.com/vowup/2 If I click change to random, program logs in console twice. For some strange reason it works ok when setting revision variable to string, but logs twice for number or any other kind of variable 回答1: Change your code to this and the answer will become clear: toggleHistory: (function() { console.log(this.get("revision")); }).observes("revision") You will see output like: 0.7038348997011781 "0.7038348997011781" Your numbers are being coerced to strings. That is caused by