Page 1 of 1

why is this code working in an init function but not click?

Posted: Sat Sep 19, 2015 2:32 pm
by jmd2004

why does this work from an init function but not on a click

var jd_phone = "63171234"
localStorage.setItem("customer_phone", jd_phone);

i'm using a button with

ng-click = save_user_settings();


why is this code working in an init function but not click?

Posted: Sat Sep 19, 2015 7:58 pm
by Evgene Karachevtsev

Hello!

Could you please clarify do you have any errors when you use this code for the button click?


why is this code working in an init function but not click?

Posted: Mon Sep 21, 2015 5:17 pm
by jmd2004

I don't see any errors. It works fine when i paste the above code into the init function. it doesn't appear that the function is firing


why is this code working in an init function but not click?

Posted: Mon Sep 21, 2015 6:21 pm
by jmd2004

user error

i had a ";" after my function.

updated

ng-click = save_user_settings();

to
ng-click = save_user_settings()

and it worked.

didn't realize you can hit cntrl-space bar to have the ng-click automatically populated from the list.