Empty action attribute on a form with angularJS

前端 未结 4 745
我在风中等你
我在风中等你 2021-01-13 10:01

I\'m trying to submit a form the normal way in a AngularJS application but I encounter an issue : it seems that I must specify the action attribute.

According to the

4条回答
  •  孤街浪徒
    2021-01-13 10:21

    You can use ng-submit.

    Form

    What's your name?

    My name is: {{name}}

    JS

    var app = angular.module('App', []);
    app.controller('AppCtrl', function($scope) {
      $scope.submit = function() {
        $scope.name = $scope.name + ' Doe';
      }
    });
    

    Plunker http://plnkr.co/edit/rqAwxWmozrzwwj4oAU5k?p=preview

提交回复
热议问题