-
Book Overview & Buying
-
Table Of Contents
MASTERING KNOCKOUTJS
By :
The ko.utils namespace is Knockout's bucket for utility functions. Not all of these functions are publicly exposed—at least not in a usable way. Knockout's minification process obfuscates more than half of them. As the unobfuscated methods are a public API that Knockout has committed to providing, changing them would be a major change. Despite considering all of the exposed methods on the ko.utils part of the API, Knockout does not provide any documentation for them.
Here is a complete list of the public functions on ko.utils as of Knockout 3.2:
addOrRemoveItem(array, item, included): If included is true, it will add the item to the array if it is not already there; if included is false, it will remove the item from the array if it is present.
arrayFilter(array, predicate): This returns an array of elements from the array that returns true from the predicate using predicate(element, index).
arrayFirst(array, predicate, predicateOwner): This returns the first element...
Change the font size
Change margin width
Change background colour