Avatar of Seven price
Seven price
Flag 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
Scripting LanguagesJavaScript

Avatar of undefined
Last Comment
Seven price

8/22/2022 - Mon
SOLUTION
Ioannis Paraskevopoulos

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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
Seven price

ASKER
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.
Ioannis Paraskevopoulos

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
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Seven price

ASKER
Ok great. Thanks again.
ASKER CERTIFIED SOLUTION
Ioannis Paraskevopoulos

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Seven price

ASKER
thanks again.
Seven price

ASKER
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
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Ioannis Paraskevopoulos

I do not quite understand the question. You are filtering the view not the values.
Seven price

ASKER
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
Seven price

ASKER
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.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Seven price

ASKER
I open another comment so you can retrieve the points. Thanks again.

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