Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

As from the documentation, we can call a filter such as a date like this:

{{ myDateInScope | date: 'yyyy-MM-dd' }}

Here date is a filter that takes one argument.

What is the syntax to call filters with more parameters both from templates and from JavaScript code?

1 Answer

0 votes
by (106k points)
edited by

To call an Angular.js filter with multiple arguments in templates, you can separate filter arguments by colons.

{{ yourExpression | yourFilter:arg1:arg2:... }}

Are you interested in learning Angularjs from the basics! Here's the right video for you on Angularjs provided by Intellipaat:

From Javascript, you call it as:-

$filter('yourFilter')(yourExpression,arg1, arg2, ...)

Want to become an Angular expert? Join this Angular Certification Training now! 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...