ember.js - EmberJS - A way to log undefined bindings -
is there way ember log warning or error if reference property doesn't exist? if misspell name of property bound in handlebar template there no warning, doesn't show anything, , can hard find property incorrect.
i have log_bindings enabled, helps somewhat, there lot of unrelated stuff sort through.
there isn't sort of general built-in debugging have found, there mechanism add own.
ember.object calls method 'unknownproperty' time 'get' call returns undefined. can add console.warn method log property. documentation describes way make custom abstract method type handling.
http://emberjs.com/api/classes/ember.observable.html#method_get
ember.object.reopen( unknownproperty: (property) -> unless property 'app' or property 'ember' console.warn "unknown property #{property} in #{@tostring()}" )
notice filtering of global namespaces 'app' , 'ember' - calls global properties still go through interface, care red herrings.
unfortunately, if try reopening ember.object itself, bunch of junk don't care about, because apparently happens time, in eventmanager classes. have gotten around applying ember.arraycontroller, ember.objectcontroller, , model class of models inherit from.
i neat warning message on console instead of blank page every time accidentally type "hight" handlebars instead of "height"
in production solution 1 want link kind of "debug" option in build, assume.
Comments
Post a Comment