Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9003989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:47:54+00:00 2026-06-16T00:47:54+00:00

I am new to angularjs. I want to use the data in filter which

  • 0

I am new to angularjs.

I want to use the data in filter which i have in my controller.

Is there any specific way to do dat?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:47:56+00:00Added an answer on June 16, 2026 at 12:47 am

    The best way is to pass the data as an additional parameter: <span>{{ value | filter:anotherValue }}</span>. This way, the value and anotherValue are controller’s scope variables. The filter is your custom filter. The filter will receive the anotherValuecontent as the second parameter, and a change to it will reapply the filter. Here is a fiddle.

    Another solution, if you it’s not proper to pass the information along all times you write the filter, is to use a shared service between them. You can then expose the properties from the controller and use in the filter. Another fiddle here (just change the input text value).

    Basically, this is what happens on the fiddle:

    // sets the shared data
    mod.controller('Ctlr', function(sharedService) {
      sharedService.data = 'something';
    }
    
    // uses the shared data
    mod.filter('customFilter', function(sharedService) {
      return function(input) {
         return input + sharedService.data;
      };
    });
    
    // the shared service that holds the data
    mod.service('sharedService', function(){ 
      this.data = 'default value';
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to AngularJS to JS in general. Now I want to use
I'm new to AngularJS. I want to use ng-repeat to render a list of
New to Regex. I want to validate to this format: Any character allowed, except
I am new to angular, I want to know if angularjs supports nested routes
I'm new to angularjs and python and I have this problem. I've been trying
I'm trying to learn AngularJS. My first attempt to get new data every second
New to Entity Framework .Using EF4. I have found articles and managed to use
I'm trying to use a jQuery plugin ( Plupload ) with AngularJS. I have
For the Domino Data Services which is new with 8.53 and the XPages Extension
I know that this is usually not the way to use AngularJS but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.