Answered step by step
Verified Expert Solution
Link Copied!

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: 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions