aboutsummaryrefslogtreecommitdiffstats
path: root/regression
diff options
context:
space:
mode:
authorMisko Hevery2010-10-13 10:51:16 -0700
committerMisko Hevery2010-10-13 10:51:16 -0700
commit3ab49538a414a36c97ed3735c2473eefcf7be073 (patch)
tree444810c3098d39a3867d728aec86249b1ea32506 /regression
parent2cb9497d02afdcfc19ea52fddcd6d1f04d81ffdb (diff)
downloadangular.js-3ab49538a414a36c97ed3735c2473eefcf7be073.tar.bz2
fixed issue where ng:bind would not reset value if expression returned undefined
Diffstat (limited to 'regression')
-rw-r--r--regression/filter_repeater.html31
1 files changed, 31 insertions, 0 deletions
diff --git a/regression/filter_repeater.html b/regression/filter_repeater.html
new file mode 100644
index 00000000..202a6311
--- /dev/null
+++ b/regression/filter_repeater.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html xmlns:ng="http://angularjs.org">
+<head>
+ <script type="text/javascript" src="../src/angular-bootstrap.js" ng:autobind></script>
+ </script>
+</head>
+<body ng:init="$window.$root = this; data = [{foo: 'foo'},{bar: 'bar'}]">
+ <p>This is a demo of a potential bug in angular.</p>
+ <p>Try the following:</p>
+ <ol>
+ <li> Type "foo" on the filter box.
+ <li> Clear the contents of the filter box.
+ <li> Type "bar" on the filter box.
+ <li> Clear the contents of the filter box.
+ </ol>
+ <p>Why doesn't the data goes back to the original?</p>
+ <hr>
+ Input: <input type="text" name="filterName" id="filterInputField"/>
+ <br/>
+ <table ng:eval="filtered_data = data.$filter(filterName)" style="border: 1px solid black">
+ <tr>
+ <th>Foo</th>
+ <th>Bar</th>
+ </tr>
+ <tr ng:repeat="record in filtered_data">
+ <td>{{record.foo}}</td>
+ <td>{{record.bar}}</td>
+ </tr>
+ </table>
+</body>
+</html> \ No newline at end of file