ng按钮错误不工作,只显示一条消息angularjs

ng-button error not working showing only one message angularjs

本文关键字:显示 一条 消息 angularjs 按钮 错误 工作 ng      更新时间:2023-09-26

只收到一条消息请在输入名称后输入名字。你能建议我对angular js很陌生吗?如果名字输入,请建议如何停止错误

 <div class="text-input">
    <label for="player-firstname">First Name *</label>
    <i class="fa fa-check-circle success" ng-show="signup.userInfo.playerFirstname.$valid"></i>
    <i class="fa fa-times-circle error" ng-show="signup.userInfo.playerFirstname.$invalid && !signup.userInfo.playerFirstname.$pristine">Pls Enter First Name</i>
    <input type="text"
      placeholder="James"
      id="player-firstname"
      name="playerFirstname"
      ng-model="player.first_name"
      tabindex="1"
      required>
  </div>
<div class="black-button medium-button float-right" ng-if="signup.$invalid">
  <button ng-click="formError()" tabindex="15"><span class="button-text">Create Account
    <i class="fa fa-chevron-right"></i>
  </button>
</div>
angular.module('users.players.signup', ['vcRecaptcha', 'services.errors'])
  .controller('playerSignup', ['user', '$scope', '$log', '$location', '$http', '$timeout', 'auth', 'vcRecaptchaService', '$routeParams', '$rootScope', 'DateUtility', 'notify', function (user, $scope, $log, $location, $http, $timeout, auth, vcRecaptchaService, $routeParams, $rootScope, DateUtility, notify) {
    'use strict';
    $scope.process
$scope.formError = function(){
      $scope.process = true;
      if($scope.first_name == null){
        notify.message("Pls enter first name");
        $scope.process = false;
        return;
      }
    }

ng-click="formError()"应该是ng-click="formErrors()"——不确定这是否是唯一的问题,但应该继续前进。