batarang icon indicating copy to clipboard operation
batarang copied to clipboard

Changing model value to invalid value fails silently

Open gary-b opened this issue 10 years ago • 1 comments

  1. Open the following app (do not change the values in the text boxes)
    • http://gary-b.github.io/ng-version-test-apps/app/v3/index.html
  2. Open batarang and select scope.$id=5
  3. Expand the 'a' object in the json tree
    • Note that the value is currently the integer 1.
  4. Change the value to be "hello" and press enter
    • Note it looks like the value has successfully changed in batarang.
  5. Click on scope.$id=6 and then back to scope.$id=5
    • Note that the value is back to 1
    • (If you change it to another number rather than a string, the number will persist)

gary-b avatar Jul 17 '15 23:07 gary-b

OK, so i was not including the quotations around the text that i was inputting, silly me. Would be nice to have some better feedback than just the dud value staying around until the jsonTree is next refreshed. If you enter the expression 30 + 30 the jsonTree immediately updates to 60, presumably as the model successfully updates and a model:change event is emitted. In this case, because evaluation of the string without quotes fails, everything stops in its tracks. I don't see a quick way to detect if that evaluation failed (chrome.devtools.inspectedWindow.eval() always returns null).

gary-b avatar Jul 18 '15 03:07 gary-b