AngularJS Login form with ng-click not working

前端 未结 2 1184
余生分开走
余生分开走 2021-01-28 22:10

I wrote a basic login form in this plunk http://plnkr.co/edit/xQEN1ZNN5ZEw1CSwNw97?p=preview (click on the red Log into Dashboard button on the Home route).

However for

2条回答
  •  长发绾君心
    2021-01-28 22:26

    The controller change I applied is:

    angular.module('routerApp').controller('LoginCtrl', function ($rootScope, $scope) {
    
        $scope.loginUser = function () {
            $scope.dataLoading = true;
            //loginService.authUser(login.user, login.password);  // TO DO !!!
        };
        $scope.test = function () {
            var test = true;
        };
    })
    

    and in the template I removed login. from the ng-if and ng-submit.

    Here is a working plunks.

提交回复
热议问题