Avatar of joyacv2
joyacv2
Flag for Puerto Rico asked on

angular js and jquery integration

Hi,

I have the following part of a code, its work, but when i click a td, i have an angular expression {{car1}} that don't change, what i can do?
 //document ready
          angular.element(document).ready(function () {

              $("td").each(function(){$(this).attr('pr1',parseFloat($(this).html().replace("$","")))});

             $("td").click(function(){
                 $scope.car1 = $scope.car1 + parseFloat($(this).attr('pr1'));
                 alert($scope.car1);
             });


          })
          //fin del document ready

Open in new window

jQueryJavaScript

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon
Julian Hansen

Apologies - just re-read the question - do you have a page online we can look at?
joyacv2

ASKER
sorry, no
joyacv2

ASKER
i can change using an id and jquery.html() function, but i want to use angular because is more simple and have a currency filter for expressions
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Julian Hansen

Ok but with only that snippet of code - sort of like bringing the spare tyre of car into the shop and asking why it won't start.
joyacv2

ASKER
ok,

how i update an <span>{{tdclicked}}</span> or any other tag, when i click a 'td' using angular js expressions?
 i want that when i click a td, then the span tag takes its value + the previous value
ASKER CERTIFIED SOLUTION
Julian Hansen

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.