Skip to content

Instantly share code, notes, and snippets.

@brianknapp
Created November 26, 2012 20:40
Show Gist options
  • Save brianknapp/4150482 to your computer and use it in GitHub Desktop.
Save brianknapp/4150482 to your computer and use it in GitHub Desktop.
Self contained knockout error bubble with close button
<div class="alert error" data-bind="css: { hidden: !errorMessage() }">
<span data-bind="text: errorMessage"></span>
<button class="close" data-bind="click: function(data, event){ errorMessage(null); } ">&times;</button>
</div>
@tlemburg
Copy link

How would this work with zend errors. You would need an extra thing to say what the error text was, then the model would have to find it, parse it, and assign it. This also pretty much duplicates what is already found in errors.js. Sorry, not everything needs to or should be done in a view model and knockout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment