Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails when no first augment is passed into the ko.observable when ko normal assigns a default value #2

Open
sudo-ben opened this issue Apr 13, 2012 · 1 comment

Comments

@sudo-ben
Copy link

No description provided.

@lavandowska
Copy link

I haven't done a Pull request, but you can fix the problem by beginning the constructor like this (only tested in the latest FireFox version):

ko[method] = function(initialValue, options) {
    // see if the initialValue is in fact the options argument, swap their values
    if (options == undefined && initialValue != undefined && initialValue.hasOwnProperty('persist')) {
        options = initialValue;
        initialValue = null;
    }

    options = options || {};
    ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants