How to update scope model after operating the filters?

Hearaman

I'm trying to update the scope model ($scope.itemsCount) after operating the filters. Please have a look at my demo code which is similar to my original functionality.

Plnkr: http://plnkr.co/edit/grnCth?p=preview

I have used $watch to update the model but it didn't worked for me.

Please suggest a solution.

Required Functionality: Scope model should be updated. I'm not looking for expression some thing like to show the count.

             (item in items|myFilter:startFiltering).length;

Thank you in advance.

JB Nizet

You just need to call a function from your scope to get the item count. This function can use apply the same filter and get the length of the filtered array.

Here's an updated demo: http://plnkr.co/edit/5Z9lAvogqSAbVNJ6eQ89?p=preview

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I update an angularjs page after a scope update?

From Dev

How to update the view after the model has changed?

From Dev

How to update the view after changing the model in Angular?

From Dev

Sailsjs: How to populate association after *update* to model?

From Dev

Sailsjs: How to populate association after *update* to model?

From Dev

How to update the view after the model has changed?

From Dev

How to sync ng-model data after $(input).val('') to $scope

From Dev

R: How to update model frame after reducing model formula

From Dev

How to update backbone.model.updated_at after a model.save

From Dev

how to update $scope object in a view after a promise is resolved in angular?

From Dev

How to update my $scope after adding new data to SQL database

From Dev

How can I update the model in parent scope from inside the child scope?

From Dev

How can I add more neurons / filters to a neural network model after training?

From Dev

How can I add more neurons / filters to a neural network model after training?

From Dev

Update scope value after dynamically update textbox

From Dev

Update JSON attribute after scope variable update

From Dev

How to update model after http POST and DELETE in angular

From Dev

How update model after inserting entry to database? And refresh a view

From Dev

How to update data after model fetch in Handlebars template with Backbone and Marionette?

From Dev

How to correctly update the Model after the ViewModel has changed?

From Dev

How to update model after http POST and DELETE in angular

From Dev

How to to get objects from the model with multiple filters?

From Dev

How to check if a model on the $scope is empty

From Dev

How to create a model scope with Geocoder?

From Dev

How to check if a model on the $scope is empty

From Dev

How to Scope Model Data in Laravel

From Dev

Ember Update model after action

From Dev

Ember Update model after action

From Dev

update jtable model after filtering

Related Related

  1. 1

    How do I update an angularjs page after a scope update?

  2. 2

    How to update the view after the model has changed?

  3. 3

    How to update the view after changing the model in Angular?

  4. 4

    Sailsjs: How to populate association after *update* to model?

  5. 5

    Sailsjs: How to populate association after *update* to model?

  6. 6

    How to update the view after the model has changed?

  7. 7

    How to sync ng-model data after $(input).val('') to $scope

  8. 8

    R: How to update model frame after reducing model formula

  9. 9

    How to update backbone.model.updated_at after a model.save

  10. 10

    how to update $scope object in a view after a promise is resolved in angular?

  11. 11

    How to update my $scope after adding new data to SQL database

  12. 12

    How can I update the model in parent scope from inside the child scope?

  13. 13

    How can I add more neurons / filters to a neural network model after training?

  14. 14

    How can I add more neurons / filters to a neural network model after training?

  15. 15

    Update scope value after dynamically update textbox

  16. 16

    Update JSON attribute after scope variable update

  17. 17

    How to update model after http POST and DELETE in angular

  18. 18

    How update model after inserting entry to database? And refresh a view

  19. 19

    How to update data after model fetch in Handlebars template with Backbone and Marionette?

  20. 20

    How to correctly update the Model after the ViewModel has changed?

  21. 21

    How to update model after http POST and DELETE in angular

  22. 22

    How to to get objects from the model with multiple filters?

  23. 23

    How to check if a model on the $scope is empty

  24. 24

    How to create a model scope with Geocoder?

  25. 25

    How to check if a model on the $scope is empty

  26. 26

    How to Scope Model Data in Laravel

  27. 27

    Ember Update model after action

  28. 28

    Ember Update model after action

  29. 29

    update jtable model after filtering

HotTag

Archive