Created
November 26, 2012 20:40
-
-
Save brianknapp/4150482 to your computer and use it in GitHub Desktop.
Self contained knockout error bubble with close button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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); } ">×</button> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.