-4
rated 0 times
[
2]
[
6]
/ answers: 1 / hits: 54549
/ 11 Years ago, sat, september 21, 2013, 12:00:00
I used to have a login dialog using bootstrap modal:
$scope.loginDialog = {
backdrop: true,
keyboard: true,
windowClass: modal loginDialog,
backdropClick: true,
templateUrl: '/tmpl/user/loginForm',
controller: function dialogController($scope, $modalInstance) {
$scope.submit = function () {
$http.post('/api/login', $scope.user).success(...);
}
}
};
Login form looks like this:
form#loginBox(ng-submit=submit())
.modal-body.login-box
.formItem
label(for='user[usernameOrEmail]') Name or Email:
input(type='text', name='user[usernameOrEmail]', required=required, value='', ng-model=user.user)
.formItem
label(for='user[password]') Password:
input(name='user[password]', type='password', value='', required=required, ng-model=user.password)
.modal-footer
input.btn.btn-primary( type=submit, value=Login)
In angular ui 0.4 and angularjs 1.1.3 this worked fine.
I've updated to the latest angular ui 0.6 and 1.2rc2 and now this no longer works. Specifically $scope.user
is no longer the same as the one in the form. How do I get the $scope of the form element? I see it in the batarang but not from the loginDialog controller.
Thanks
More From » twitter-bootstrap