Link to home
Create AccountLog in
Avatar of Seven price
Seven priceFlag for United States of America

asked on

angularjs ng-click function not working

the click event
  <a href="#" ng-click="myNum(l.GroupID)">{{l.Desc}}</a>

Open in new window

I need it to change the value
 $scope.mypage = 1;  // Need to change here and submit.
                                               
                                              $scope.myNum = function (num) {

                                                   $scope.mypage = num;
                                                   alert($scope.mypage);
                                                   $scope.todo.items.push({GroupID: num, done: false });
                                         
                                               }

Open in new window

so if you was to change  $scope.mypage = 1 to  $scope.mypage = 2 you see the table change.



http://plnkr.co/edit/bptVckBXQC72anPGzDmR?p=preview
SOLUTION
Avatar of Ioannis Paraskevopoulos
Ioannis Paraskevopoulos
Flag of Greece image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Seven price

ASKER

Ok so how can I use the ng show to filter by ng click . I want to pass the value to ng show from the ng click.  Also thanks
oh that was great. ok. the rest of the form that is not showing up. Is there a way to hold the values when I click to another page. so if I put something in the text box click on link and then go back can I get it to keep the input value I entered.
Hi,

I am away frim a pc, but if i remember well your code, yes on both questions. I will have to answer tomorrow though.

Giannis
Ok great. Thanks again.
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
thanks again.
have a quick question and this is goes with why i use ng-show. how can i get all the values if I am filtering the form
I do not quite understand the question. You are filtering the view not the values.
I know but how can I retrieve the values on one submit. or should I change everything to and she show where everything is hidden in the dom but I could still retrieve all the values
Sorry I was driving. I want to retrieve all the values and submit them at once. I know I am filtering. i was wondering does angularjs hold the values in the ng-model and I can submit them at once.
I open another comment so you can retrieve the points. Thanks again.

https://www.experts-exchange.com/questions/28627780/angularjs-retrieve-values.html