aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/directive/ngRepeatSpec.js
diff options
context:
space:
mode:
authorRhys Brett-bowen2013-11-18 10:02:55 -0500
committerIgor Minar2013-12-16 10:37:18 -0800
commitcbb3ce2c309052b951d0cc87e4c6daa9c48a3dd8 (patch)
treee08b17b430eaa71b9c2ba149d94dcd4addbd5b77 /test/ng/directive/ngRepeatSpec.js
parent45af02de0457881f269b52d6c3f0ed58da53cfac (diff)
downloadangular.js-cbb3ce2c309052b951d0cc87e4c6daa9c48a3dd8.tar.bz2
fix(ngRepeat): allow multiline expressions
allow and pass through new line characters when checking passed in expression Closes #5000
Diffstat (limited to 'test/ng/directive/ngRepeatSpec.js')
-rw-r--r--test/ng/directive/ngRepeatSpec.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ng/directive/ngRepeatSpec.js b/test/ng/directive/ngRepeatSpec.js
index bdc0b8f5..2d70d4a4 100644
--- a/test/ng/directive/ngRepeatSpec.js
+++ b/test/ng/directive/ngRepeatSpec.js
@@ -177,6 +177,22 @@ describe('ngRepeat', function() {
});
+ it('should allow expressions over multiple lines', function() {
+ scope.isTrue = function() {
+ return true;
+ };
+ element = $compile(
+ '<ul>' +
+ '<li ng-repeat="item in items\n' +
+ '| filter:isTrue">{{item.name}}</li>' +
+ '</ul>')(scope);
+ scope.items = [{name: 'igor'}];
+ scope.$digest();
+
+ expect(element.find('li').text()).toBe('igor');
+ });
+
+
it('should track using provided function when a filter is present', function() {
scope.newArray = function (items) {
var newArray = [];