diff --git a/src/ng/parse.js b/src/ng/parse.js index 99c023cb919d..3599b7f25947 100644 --- a/src/ng/parse.js +++ b/src/ng/parse.js @@ -545,7 +545,7 @@ AST.prototype = { var args = []; if (this.peekToken().text !== ')') { do { - args.push(this.expression()); + args.push(this.filterChain()); } while (this.expect(',')); } return args; diff --git a/test/ng/parseSpec.js b/test/ng/parseSpec.js index c823b3a9e938..116bd9f06de2 100644 --- a/test/ng/parseSpec.js +++ b/test/ng/parseSpec.js @@ -2139,6 +2139,15 @@ describe('parser', function() { expect(scope.$eval("add(1,2)")).toEqual(3); }); + it('should allow filter chains as arguments', function() { + scope.concat = function(a, b) { + return a + b; + }; + scope.begin = 1; + scope.limit = 2; + expect(scope.$eval("concat('abcd'|limitTo:limit:begin,'abcd'|limitTo:2:1|uppercase)")).toEqual("bcBC"); + }); + it('should evaluate function call from a return value', function() { scope.getter = function() { return function() { return 33; }; }; expect(scope.$eval("getter()()")).toBe(33);