
如果用户选择了“否”单选选项按钮,我如何重定向到 /signup?
路线
// app/routes/users.js
app.post('/users/session', passport.authenticate('local', {
failureRedirect: '/signin',
failureFlash: true
}), users.session);
看法
<form action="/users/session" method="post">
<input ng-change="change()" ng-model="NotSureWhatToPutHere" type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
<label for="optionsRadios1">
No, I am a <b>new customer</b>.
</label>
<input type="radio" ng-model="NotSureWhatToPutHere" ng-change="change()" name="optionsRadios" id="optionsRadios2" value="option2">
<label class="control-label" for="optionsRadios2">
Yes, I have a password:
</label>
<button type="submit">Sign in</button>
</form>
控制器
// controllers/index.js
'use strict';
angular.module('mean.system').controller('IndexController', ['$scope', 'Global', function ($scope, Global) {
$scope.global = Global;
}]);