<h1>Example: ngSubmit</h1>
<p>ngSubmitはsubmitイベントをリスナー登録します。</p>
<div ng-app="myApp">
  <div ng-controller="myController">
    <form ng-submit="submit()">
      <label>
        <input type="checkbox" ng-model="myModel"> 同意する
      </label>
      <input type="submit" value="submit">
    </form>
    <p>{{ message }}</p>
  </div>
</div>
@import "bourbon";

body {
  padding: 1.5rem;
}
View Compiled
var app = angular.module('myApp', []);

app.controller('myController', ['$scope', function($scope){
  $scope.submit = function(){
    $scope.message = (!$scope.myModel)? 'チェックしてください' : ''; 
  }
}]);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js