Skip to content

Commit

Permalink
Update computed filtering examples to include .extend({notify:'always'})
Browse files Browse the repository at this point in the history
  • Loading branch information
mbest committed Oct 5, 2013
1 parent 602ba79 commit 30fcc9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions documentation/computedObservables.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Example 1 showed how a writeable computed observable can effectively *filter* it
Taking this a step further, you could also toggle an `isValid` flag depending on whether the latest input was satisfactory, and display a message in the UI accordingly. There's an easier way of doing validation (explained below), but first consider the following view model, which demonstrates the mechanism:

function MyViewModel() {
this.acceptedNumericValue = ko.observable(123);
this.acceptedNumericValue = ko.observable(123).extend({notify:'always'});
this.lastInputWasValid = ko.observable(true);

this.attemptedValue = ko.computed({
Expand All @@ -161,7 +161,7 @@ Taking this a step further, you could also toggle an `isValid` flag depending on
}
},
owner: this
});
}).extend({notify:'always'});
}

ko.applyBindings(new MyViewModel());
Expand Down
2 changes: 1 addition & 1 deletion documentation/extenders.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ko.extenders.numeric = function(target, precision) {
}
}
}
});
}).extend({notify:'always'});

//initialize with current value to make sure it is rounded appropriately
result(target());
Expand Down

0 comments on commit 30fcc9a

Please sign in to comment.