Skip to content
This repository has been archived by the owner on Feb 9, 2020. It is now read-only.

Changing model value to invalid value fails silently #245

Open
gary-b opened this issue Jul 17, 2015 · 1 comment
Open

Changing model value to invalid value fails silently #245

gary-b opened this issue Jul 17, 2015 · 1 comment

Comments

@gary-b
Copy link
Contributor

gary-b commented Jul 17, 2015

  1. Open the following app (do not change the values in the text boxes)
  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
Copy link
Contributor Author

gary-b commented Jul 18, 2015

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 gary-b changed the title Cannot change a model value from an integer to a string Changing model value to invalid value fails silently Jul 18, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants