RedSparkle
RedSparkle

Reputation: 579

Formatting values with AngularJs filters

I am writing a common control that will be used to format data inside a grid. It has 2 parameters that user can set:

In the code I am going to call $filter(filter)(value, ...) - here is my problem. How do I pass my parameters? Each filter can have from no parameters to who knows how many. So, is there a nice way to pass variable number of parameters in Angular? So far I did not run into a way of doing it.

Upvotes: 0

Views: 39

Answers (1)

BroiSatse
BroiSatse

Reputation: 44675

You should be able to do:

$filter(filter).apply(this, parameters)

Upvotes: 1

Related Questions