jmd2004
Posts: 1
Joined: Wed Jan 28, 2015 7:06 pm

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

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();

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

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

Hello!

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

jmd2004
Posts: 1
Joined: Wed Jan 28, 2015 7:06 pm

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

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

jmd2004
Posts: 1
Joined: Wed Jan 28, 2015 7:06 pm

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

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.

Return to “Issues”