Created
February 25, 2011 20:17
-
-
Save arantius/844416 to your computer and use it in GitHub Desktop.
angular ng:switch + comment test case
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> | |
<script type="text/javascript" ng:autobind src="http://code.angularjs.org/0.9.10/angular-0.9.10.js"></script> | |
</head> | |
<body ng:init="value='foo'"> | |
<p>The ng:switch construct fails when one of its children is a comment.</p> | |
<p>Works (when the bug isn't triggered on the same page):</p> | |
<ng:switch on="value"> | |
<div ng:switch-when="foo">Value is foo.</div> | |
<div ng:switch-when="bar">Value is bar.</div> | |
</ng:switch> | |
<p>Fails:</p> | |
<ng:switch on="value"> | |
<div ng:switch-when="foo">Value is foo.</div> | |
<!-- This comment causes a failure, when trying to .attr() the comment node. --> | |
<div ng:switch-when="bar">Value is bar.</div> | |
</ng:switch> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment