angular / angular-hint

run-time hinting for AngularJS applications
362 stars 45 forks source link

fix(scopes) maintain id data type #110

Closed gary-b closed 9 years ago

gary-b commented 9 years ago

In batarang if you do not have the scopes tab open when the app loads or if you navigate to another tab after the app has loaded the jsonTree stops working correctly. This was down to it ignoring model:change events. This was caused by the fact angular 1.3+ uses int ids while batarang was storing them as keys in objects. It would pass hint the id as a string, hint would find the scope and emit an event, but would also echo back the id as a string. Problem is the jsonTree maintains a type correct version of the Id, and strict comparisons then failed, hence no UI update occurred. Updating so hint always returns the id in the type dictated by the current angular version, regardless of the type of the id passed to it.

gary-b commented 9 years ago

Similar code existed further down the file that also didn't have the radix, fixed now.

SomeKittens commented 9 years ago

LGTM

btford commented 9 years ago

:+1: @SomeKittens feel free to merge this

SomeKittens commented 9 years ago

Passes tests, landed in 0f51832

Note that we'll have to re-build hint for this to end up in dist/hint.js