No description or website provided.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
spec
src
.editorconfig
.gitignore
.jshintrc
.travis.yml
Gruntfile.js
README.md
bower.json
karma.conf.js
package.json

README.md

Readonly binding for knockout

Build status

Usage

HTML

<input data-bind="readonly: myobs" >

JS

ko.applyBindings({
    myobs : ko.observable()
});

This binding is written in AMD. It returns the binding object. It will attach itself to knockout.bindingHandlers.readonly once required for the first time. This can be overridden with a config section in your requirejs config like shown below.

requirejs.config({
    config: {
        'bower_components/knockout.bindingHandlers.readonly/src/readonly': {
            name: 'someOtherName'
    }
});

Behaviour

Sets the readonly attribute if the observable is truthy.

Demo

There is a demo at http://mokkabonna.github.io/knockout.bindingHandlers.readonly

Dependencies

  • knockout

For accurate versions check bower.json

Contributing

Clone, then run (assuming you have node)

npm install & bower install

You can now use grunt develop for a ready made watch task for development. Tests, linting..

grunt develop