Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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: stringthrough emitusername password
Requirements
Create an input element for the username field. It should have its id set to usernaseInput 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 passwordInput 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 loginbutton
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started