JavaScript Allow Remember Password to work with AngularJS allow chrome to remember password

Okay, I spent all morning trying to solve this, and despite the fact that it seems to have been a problem for a couple years, I couldn't find a solution that worked. I've seen other people on Stack Overflow ask this question, but none of them had working answers.

My Angular app's login form works fine, but the remember password dialog won't pop up in either Chrome or Opera. It does work in Firefox. I understand WHY it doesn't work, but my users are complaining and I need to fix it. What can I do?

<form name="loginForm" ng-submit="login(user)">
  <div class="input-group">
    <input type="email" name="email" class="form-control" placeholder="Email" ng-model="user.email">
  </div>
  <div class="input-group">
    <input type="password" name="password" class="form-control" placeholder="Password" ng-model="user.password">
  </div>
  <button type="submit" class="btn btn-default">Login</button>
</form>

Edit: Okay, from a couple different answers that didn't work, I was able to piece together something that finally did, which was simply to turn it into an entirely normal HTML form where the button is type="submit" and then simply put a jQuery .click command in my javascript which calls the login function. So basically, just completely ignored the Angular way of doing it, which makes me a sad panda. :-\ Opera still doesn't work, but I don't care a ton about that I guess.

Answer:1

this is the code from Timothy E. Johansson's blog. I do not take credit.

app.directive("ngLoginSubmit", function(){
return {
    restrict: "A",
    scope: {
        onSubmit: "=ngLoginSubmit"
    },
    link: function(scope, element, attrs) {
        $(element)[0].onsubmit = function() {
            $("#login-login").val($("#login", element).val());
            $("#login-password").val($("#password", element).val());

            scope.onSubmit(function() {
                $("#login-form")[0].submit();
            });
            return false;
        };
    }
};
});

$scope.login = function(submit) {
    $scope.user = {
        login: $("#login").val(),
        password: $("#password").val()
    };

    function ajaxCallback() {
        submit();
    }   

    return false;
};
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

<form name="login-form" id="login-form" method="post" action="" style="display: none;">
    <input name="login" id="login-login" type="text">
    <input name="password" id="login-password" type="password">
</form>

<form name="login-form" autocomplete="on" ng-login-submit="login">
    <input id="login" name="login" type="text" autocomplete="on">
    <input id="password" name="password" type="password" autocomplete="on">
</form>
Answer:2

New with JavaScript. Can someone help me understand why calling print() returns undefined? class Quizer { constructor(quizObj) { this.quiz = quizObj; } print() { console....

New with JavaScript. Can someone help me understand why calling print() returns undefined? class Quizer { constructor(quizObj) { this.quiz = quizObj; } print() { console....

  1. javascript class constructor example
  2. javascript class constructor arguments
  3. javascript class constructor array
  4. javascript class constructor async
  5. javascript class constructor super
  6. javascript class constructor with parameters
  7. javascript class constructor function
  8. javascript class constructor overloading
  9. javascript class constructor call method
  10. javascript class constructor not called
  11. javascript class constructor shorthand
  12. javascript class constructor object
  13. javascript class constructor name
  14. javascript class constructor syntax
  15. javascript class constructor es6
  16. javascript class constructor not working
  17. javascript class constructor initialize
  18. javascript class constructor prototype
  19. javascript class constructor spread
  20. javascript class constructor destructuring

I'm inherited an HTML form that uses the js with() function: with (document.images.myImage.style) { left = x + "px"; top = y + "px"; visibility = "visible"; } This code "moves" an ...

I'm inherited an HTML form that uses the js with() function: with (document.images.myImage.style) { left = x + "px"; top = y + "px"; visibility = "visible"; } This code "moves" an ...

  1. javascript with function parameter
  2. javascript with function
  3. javascript with function scope
  4. javascript function with return
  5. javascript function with return value
  6. javascript function with optional parameters
  7. javascript function with arguments
  8. javascript function with callback
  9. javascript function with array parameter
  10. javascript function with string parameter
  11. javascript function with default parameters
  12. javascript function with multiple parameters
  13. javascript function with variable
  14. javascript function with variable arguments
  15. javascript function with object parameter
  16. javascript function with callback parameter
  17. javascript function with return type
  18. javascript function with default value
  19. javascript function with asterisk
  20. javascript function with parameter default value

It's easy to set attribute for a given element: el.setAttribute('rel', 'nofollow'); But for some attributes, such as rel in the example, multiple values are allowed. In case of rel, its values ...

It's easy to set attribute for a given element: el.setAttribute('rel', 'nofollow'); But for some attributes, such as rel in the example, multiple values are allowed. In case of rel, its values ...

  1. multiple values attribute magento
  2. multiple values attribute beautifulsoup
  3. multiple attribute values in xml
  4. multiple attribute values in html
  5. xpath multiple values attribute
  6. multiple values in attribute
  7. css multiple attribute values
  8. multiple values in data attribute
  9. jquery multiple attribute values
  10. xslt multiple attribute values
  11. multiple values in data attribute html
  12. ldap multiple attribute values
  13. multiple values in class attribute
  14. xsl multiple attribute values
  15. multiple values in style attribute
  16. select multiple attributes values
  17. css selector multiple attribute values
  18. xpath select multiple attribute values
  19. jquery selector multiple attribute values
  20. css select multiple attribute values

I just read this SO question/answer and it said to change the color, use console.log("%cYour Message Here", "color:(your color);font-weight:bold;"); I have tested this and messed around with it a ...

I just read this SO question/answer and it said to change the color, use console.log("%cYour Message Here", "color:(your color);font-weight:bold;"); I have tested this and messed around with it a ...

  1. multiple personality eye color change
  2. select2 multiple change color
  3. multiple personality disorder eye color change
  4. change multiple color
  5. mat select multiple change color