fix(forms): do not reset the value of the input when it came from the view

This commit is contained in:
vsavkin
2015-07-15 18:16:50 -07:00
parent b1df54501a
commit b1231593b6
11 changed files with 81 additions and 34 deletions
@@ -71,6 +71,15 @@ export function main() {
expect(onChange).toEqual(["invoked", "newValue"]);
});
it("should not invoke on change when explicitly specified", () => {
var onChange = null;
c.registerOnChange((v) => onChange = ["invoked", v]);
c.updateValue("newValue", {emitModelToViewChange: false});
expect(onChange).toBeNull();
});
it("should update the parent", () => {
c.updateValue("newValue");
expect(g.value).toEqual({"one": "newValue"});