Question: Your task is to create a simple login form component in Angular. The form should consist of two input fields: one for username and one

Your task is to create a simple login form component in Angular.
The form should consist of two input fields: one for username and one for password. Each input should update its value attribute on input change
There should also be a Submit button. It should emit the login event when clicked.
Parent component listens to login event through login EventEmitter defined in the initial code. It accepts the following object (username: string, password: string)(through emit({username, password})
Requirements
Create an input element for the username field. It should have its id set to usernase-Input and
Type attribute set to text The usermane input should update its value attribute on being changed with the entered username
Create an input element for the password field. It should have its id set to password-Input and type attribute set to password
The password input should update its value attribute on being changed with the entered password
Create a Submit button with its set to login-button
The Submit button should be disabled (disabled attribute set to true) until both username and password fields are filled.
The login event should be emitted when the Submit button is clicked
The login event should be emitted with {username, password} object passed as parameter.
The styling and layout of the components is not assessed Place them within the main < div> in the provided starting code Wrapping inputs and the Submit button in the form element is not needed
Additional information
Library versions
The application uses Aguiar 10.1.0. Initial code has several imports to show what's available. Module containing the component from the task has the following imports
imports: [BrowserModule, ReactiveFormsModule, FormsModule]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!