Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

265
Views
Variable value not getting updated - Angular JS

I am working on an Angular JS project and i have a function to reset the filters in a page. What i am trying to do is pretty basic. setting all the filters to empty and calls searchStudents() which will list the full students list. this.nameSearch is a text field and this.genderField and this.skillsFilter is a select dropdown which i am binding with ng-model.

 function resetAllFilters() {
    this.nameSearch = "";
    this.genderFilter = "";
    this.skillsFilter = "";
    searchStudents();
  }
 function searchStudents() {
        if (!!this.genderFilter) {
            this.gender = self.genderFilter;
        }
        if (!!this.skillsFilter) {
            this.skills = this.skillsFilter;
        }
        params = {
            search: this.nameSearch
            skills: this.skills,
            gender: this.gender
            startsWith: "",
            startRow: startRow,
            pageSize: this.studentsPerRequest
        };
        this.loading = true;
        StudentService.students.get(params).$promise.then(
            function(response) {
                console.log(response);
            });
    }

function resetAllFilters() is invoked on a rest button click. when i select either of the gender of skills from dropdown the list is filtered. but when i click on reset the values in the dropdown gets reset but it doesn't reflect the values in searchStudents(). the list gets updated with the same previous filtered value instead of the whole list. any inputs will be appreciated . thanks in advance

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!