Created
February 17, 2011 19:54
-
-
Save arantius/832513 to your computer and use it in GitHub Desktop.
This file contains 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
<!doctype html> | |
<html xmlns:ng="http://angularjs.org"> | |
<head> | |
<title>Angular Newline-In-Option Test</title> | |
<script src="http://code.angularjs.org/angular-0.9.10.min.js" ng:autobind></script> | |
</head> | |
<body ng:init='event={};sites=[{"id": "96b1a3ce-0b26-40df-8f5a-2017f5a7fcbd", "name": "Name Only"}, {"id": "983aea62-b6a7-4e0a-bde1-5c48eb3ad19e", "name": "Check Box Condition Only"}]'> | |
<p>With newlines inside the option node, fail:</p> | |
<select name="event.site1" id="location"> | |
<option value="">Please select...</option> | |
<option ng:repeat="site in sites" value="{{site.id}}"> | |
{{site.name}} | |
</option> | |
</select> | |
<p>Without, OK:</p> | |
<select name="event.site2" id="location"> | |
<option value="">Please select...</option> | |
<option ng:repeat="site in sites" value="{{site.id}}">{{site.name}}</option> | |
</select> | |
<p>Inspect the (generated) source, or the bound model below. The content of the option node is incorrectly assigned as the value, rather than the value attribute's contents.</p> | |
<pre>{{event}}</pre> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment