javascript - Unable to clear the form after login on ionic -


i trying use code here

i trying design login form in ionic facing 2 issues:

1.cant understand why have used 2 submits in example:

<form name="signinform" novalidate="" ng-submit="signin(signinform)"> 

and:

<button class="button button-block button-positive" ng-click="signin(user)"> 

2.i error when trying clean fields using:

$scope.user.remove();  

the error:

typeerror: cannot read property 'remove' of undefined

my code looks like:

$scope.$on('event:auth-loginconfirmed', function() {     $scope.user.remove();     $state.go('app.placeslists'); });   $scope.signin = function(form) {     if (form.$valid) {         authenticationservice.login($scope.user);     } }; 

  1. cant understand why have used 2 submits in example:

i cannot sure why coder chose add 2 submit events, removed ng-click , works fine, because not requiring user object, since in scope. can remove ng-click button.

  1. i error when trying clean fields using:

this should work empty fields:

$scope.user = { username: '', password: '' }; 

this code empty user scope.

remove() won't work in angularjs.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -