Hi Shivang, This was really really helpful, saved lot of time!!! Thanks, Bakul
On Thursday, June 5, 2014 at 5:33:27 PM UTC+5:30, SHIVANG SANGHI wrote: > > I have updated the code...Check this.. >> HTML: >> {{pageSize}} >> <select name="pageSize" id="pageSize" ng-model="pageSize" >> ng-change=*"update(pageSize);"*> >> <option value="5">5</option> >> <option value="10">10</option> >> <option value="25">25</option> >> <option value="50">50</option> >> </select> >> >> Controller: >> $scope.pageSize = 5; >> >> $scope.update = function(pageSize) { >> > $scope.pageSize = pageSize; > >> console.log("pageSize = "+$scope.pageSize); >> reviewService.fetch({ >> pageSize: $scope.pageSize, >> }).success(function(data, status) { >> console.log("success!"); >> $scope.reviewData = data.d; >> $scope.nrOfPages = >> Math.ceil($scope.reviewData.summary.ReviewCount / $scope.pageSize); >> }).error(function(data, status) { >> console.log("error!"); >> $scope.error = true; >> }); >> } >> $scope.update(); >> >> So to be clear: >> * $scope.update() gets called correctly by ng-change. >> * the log($scope.pageSize) always logs '5'. >> * {{pageSize}} shows the value I selected. >> >> >> mcv. >> > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.