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

前端 未结 8 931
暖寄归人
暖寄归人 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:18

    Explanation:

    AngularJS 1.x registers any form DOM element that has a name property in $scope via formDirectiveFactory. This directive automatically instantiates form.FormController if the above is true:

    If the name attribute is specified, the form controller is published onto the current scope under

    from: angular.js:24855

    Hence if you have a

    it will override your $scope.myForm = function() { ... }

提交回复
热议问题