I do not know where to use a property or functions. Could you explain in detail to me that hasCellphone is a function or property here. And when it can be a property or function. What should we use?
enable: hasCellphone or
enable: hasCellphone () and why so.
<input type='checkbox' data-bind="checked: hasCellphone" />
I have a cellphone
Your cellphone number:
<input type='text' data-bind="value: cellphoneNumber, enable: hasCellphone" />
<script type="text/javascript">
var viewModel = {
hasCellphone : ko.observable(false),
cellphoneNumber: ""
};
</script>
source
share