フォームの検証が偽であるときにエラーメッセージを表示しようとしています。しかし、メッセージは常に見えます。角型フォームエラーメッセージ
<body ng-app="myApp2" >
@include('header')
<div ng-controller="ExampleController">
<form name="user-form" method="POST" action="{{route('registrationUser')}}">
{{route('registrationUser')}}">
<div class="form-group">
<div class="form-group">
<label for="firstName" class="col-sm-3 control-label">
Номер телефона
</label>
<input type="text" ng-pattern="phoneNumbr" name="phone" required>
<span class="error" ng-show="myForm.phone.$error.required">
Required!
</span>
<span class="error" ng-show="myForm.phone.$error.minlength">
Phone no not less that 10 char.
</span>
<span class="error" ng-show="myForm.phone.$error.maxlength">
Phone no not more than 11 char.
</span>
<br><span class="error" ng-show="myForm.phone.$error.pattern">
Please match pattern [+91-036-78658 || 91-036-78658]
</span>
</div>
<div class="form-group">
<button ng-click='SaveUser()' name="Регистрация" class="btn btn-primary col-sm-offset-3">
Регисрация
</button>
{{ csrf_field() }}
</div>
</div>
</form>
</div>
<script>
var app = angular.module('myApp2', []);
$scope.positions = '';
app.controller('ExampleController', function($scope) {
$scope.positions=Positions;
$scope.phoneNumbr = /^\+?\d{2}[- ]?\d{3}[- ]?\d{5}$/;
});
</script>
</body>
ブラウザコンソールにエラーメッセージはありますか? – Tamali
エラー:[$ controller:ctrlreg] http://errors.angularjs.org/1.6.6/$controller/ctrlreg?p0=ExampleController – Dmitry
質問に追加してください。 – bastelflp