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

前端 未结 8 932
暖寄归人
暖寄归人 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条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-17 08:27

    Edge case here, but I want to mention it for posterities' sake. I got this same error when using the controllerAs pattern with a form name with the same value as ng-submit. For example:

    Throws: TypeError: v2.signUp is not a function

    The solution was to change the name of the form to something different:

提交回复
热议问题