Simple AngularJS Form is undefined in Scope

前端 未结 7 1823
独厮守ぢ
独厮守ぢ 2020-12-13 03:33

I\'m starting to play around with AngularJS forms in jsfiddle and I\'ve come across a problem already where a very simple form example is not working as expected. All I have

7条回答
  •  醉梦人生
    2020-12-13 04:15

    This is the recommended way to access form variable: https://docs.angularjs.org/guide/forms - Binding to form and control state

    In HTML:

    Youl will pass the name of the form as a variable to the function.

    In JS :

    $scope.reset = function(form) { 
      alert(form); 
    };
    

    Variable 'form' should NOT be undefined now.

提交回复
热议问题