1

I want launch a uikit notification after login in my system or when I fail in the login by password or user incorrect. I think that I can to do it using AngularJS. In my project when I try login, first my data are send to a controller that send this data a django view.

login.html

  <div class="input" ng-controller="conIngreso">

    {% csrf_token %}

    <div class="login-input-group spacer-field">
      <span class="login-input-group-addon">
        <i class="fa fa-at fa-fw"></i>
      </span>
      <input type="email" class="form-control" name="email" placeholder="Correo electrónico" ng-model="email">
    </div>
    <div class="login-input-group">
      <span class="login-input-group-addon">
        <i class="fa fa-key fa-fw"></i>
      </span>
      <input type="password" class="form-control" name="password" placeholder="Contraseña" ng-model="password">
    </div>

    <button class="btn btn-default btn-lg submit" type="submit" ng-click="ingresar(email, password)">Ingresar</button>
  </div>

conIngreso.js

var app = angular.module('appLogin');

app.controller('conIngreso', ['$scope', '$http', function($scope, $http){
$scope.user={email:'',password:''}

$scope.ingresar=function(email,password){
    $http({method:'POST',
        url:'/cliente/ingreso/',
        data:$.param({email: email, password: password})
    }).then(
        function(response2){
            //UIkit.notification("...", {pos: 'top-right'});
            window.location.href='javascript:history.back()';
        },function(response2){
            $scope.user = response2.data || 'Request failed';
        }
    );
}
}])

In the conIngreso.js file above I try to do it before window.location...

But does not work

Thanks

1 Answer 1

1

its

UIkit.notify

and you are using

UIkit.notification
Sign up to request clarification or add additional context in comments.

1 Comment

I'm using this UIkit.notification({ message: "<span uk-icon='icon: check'></span> Welcome", status: 'success', pos: 'top-center', timeout: 5000 });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.