AngularJS error: TypeError: v2.login is not a function

前端 未结 8 929
暖寄归人
暖寄归人 2021-01-17 07:49

I would like to call the login function when I click the login button but keep getting the error message in the title. Can someone point out the error in my script?

8条回答
  •  梦毁少年i
    2021-01-17 08:16

    In my case, I was having an exact same issue as yours. However, coming across gkalpak's answer to such a scenario helped me out.

    Turned out to be what I was calling was addBuddy() function, from a form named "addBuddy". The solution was to change the name of either of the two things to make one stand out or differentiable from the other. I changed the name of the form to "addBuddyForm" and voila! My function worked!

    Here's a snippet of my case:

    ...
提交回复
热议问题