2
我正在用Express學習Angular。我的登錄表單驗證不起作用。這裏是玉代碼:快速角度驗證
extends ../layout
script(type='text/javascript' src='../javascripts/admin/login.js')
block content
.container
.row
.loginform(ng-controller='ExampleController')
form.form-horizontal(name='loginForm' novalidate)
.control-group
label.control-label(for='inputEmail') Email
.controls
input(type='email' placeholder='Email' ng-model='login.email' name='uemail' required)
div(ng-show='loginForm.uemail.$dirty && loginForm.uemail.$invalid')
span(ng-show='loginForm.uemail.$error.required')
span.help-inline Email is required
span(ng-show='loginForm.uemail.$error.email')
span.help-inline Please fill a valid Email
.control-group
label.control-label(for='inputPassword') Password
.controls
input(type='password' placeholder='Password' ng-model='login.password')
.control-group
.controls
button.btn(type='submit') Sign in
我login.js是:
angular.module('formExample', [])
.controller('ExampleController', ['$scope', function($scope) {
$scope.master={};
}]);
我檢查了,我的所有腳本文件都得到網頁上加載。控制檯上沒有錯誤。請指教。