Form returns [object Object]

0

I am creating a login form in Angular. The form has two fields: user and password . Now I want to simply capture these inputs and print them in the console. However, it throws [object Object] . I show you the code:

The form:

<form #formLogin="ngForm" (ngSubmit)="onLoginEasy(formLogin)">
    <div class="form-group">
        <label for="user">User</label>
        <input type="text" class="form-control" id="user" name="user">
    </div>
    <div class="form-group">
        <label for="password">Password</label>
        <input type="text" class="form-control" id="password" name="password">
    </div>
    <input type="submit" value="Login" class="btn btn-primary btn-block">
</form>

The function that you should print in the console:

onLoginEasy(value) {
    console.log('Valores= ' + value);
  }

Thank you very much!

    
asked by Joan Subirats Llaveria 20.09.2018 в 18:59
source

0 answers