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

can't put empty string on a 'div' with 'data-bind' #53

Closed
quartzo opened this issue Oct 13, 2011 · 1 comment
Closed

can't put empty string on a 'div' with 'data-bind' #53

quartzo opened this issue Oct 13, 2011 · 1 comment

Comments

@quartzo
Copy link
Contributor

quartzo commented Oct 13, 2011

This code doesn't change the DOM:

// Bind model to element's HTML content
var message = $$({txt:"I'm text from a model"}, '<div data-bind="txt"/>');
$$.document.append(message);
message.model.set({'txt':''});

Simplest correction:

@@ -582,7 +582,7 @@
                 if (self.model.get(bindData.key)) {
                   $node.text(self.model.get(bindData.key).toString());
                 } else {
-                  $node.text( null );
+                  $node.text('');
                 }
               });
             }
@tristanls
Copy link
Collaborator

Thanks @quartzo. Submitted the fix in #54

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