Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

266
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda