我有部分代碼如下圖所示:AngularJS初學者需要的代碼解釋
angular.module('tessicommunicationApp')
.controller('RegisterController', function ($scope, $translate, $timeout, Auth) {
$scope.success = null;
$scope.error = null;
$scope.doNotMatch = null;
$scope.errorUserExists = null;
$scope.registerAccount = {};
$timeout(function(){angular.element('[ng-model="registerAccount.login"]').focus();});
我的問題很簡單:我不設法找到其中聲明的登錄屬性。因爲模板,我可以讀:
<input type="text" class="form-control" id="login" name="login" placeholder="{{'global.form.username.placeholder' | translate}}"
ng-model="registerAccount.login" ng-minlength=1 ng-maxlength=50 ng-pattern="/^[a-z0-9]*$/" required>
的NG-模型指令綁定登錄屬性,我不知道它在哪裏聲明。
下面的路線的一部分,如果你想:
angular.module('tessicommunicationApp')
.config(function ($stateProvider) {
$stateProvider
.state('register', {
parent: 'account',
url: '/register',
data: {
authorities: [],
pageTitle: 'register.title'
},
views: {
'[email protected]': {
templateUrl: 'scripts/app/account/register/register.html',
controller: 'RegisterController'
}
},
謝謝您的解答。