213 shaares
2 résultats
taggé
html
Dans ce cas, l'event à binder n'est pas (submit) mais (ngSubmit) :
<div class="container">
<div class="logo">Create a new account!</div>
<div class="register-item">
<form #myform="ngForm" (ngSubmit)="register(myform)" class="form form-register">
<div class="form-field">
<label class="user" for="register-username"><span class="hidden">Name</span></label>
<input name="name" id="register-username" type="email" class="form-input" placeholder="Name" ngModel required>
</div>
<div class="form-field">
<label class="user" for="register-email"><span class="hidden">Email</span></label>
<input name="email" id="register-email" type="email" class="form-input" placeholder="Email" ngModel required>
</div>
<div class="form-field">
<label class="lock" for="register-password"><span class="hidden">Password</span></label>
<input name="password" id="register-password" type="password" class="form-input" placeholder="Password" ngModel required>
</div>
<div class="form-field">
<input type="submit" value="Register">
</div>
</form>
</div>
</div>
Je recopie :
This should work with any div or screen size:
.center-screen {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
min-height: 100vh;
}
<html>
<head>
</head>
<body>
<div class="center-screen">
I'm in the center
</div>
</body>
</html>