Hi,
I have to display like below in textarea when user type in name, Address and Phone
Name: ABC
Address: XYZ
Phone: XXX

Hi,
I have to display like below in textarea when user type in name, Address and Phone
Name: ABC
Address: XYZ
Phone: XXX

Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 4, 2023, 1:56 AM EST
Hi Amit,
Please use this one which will help you out,
UI Page :
TypeScript :
// app.component.ts import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { textbox1: string = ''; textbox2: string = ''; textbox3: string = ''; resultTextarea: string = ''; concatenateValues() { // Concatenate values from textboxes this.resultTextarea = `$ Name : {this.textbox1} \n Address : ${this.textbox2} \n Phone : ${this.textbox3}`; } }Ramesh PalanivelRank #372 · 6.8K reputationPosted Dec 4, 2023, 1:14 AM EST
Hi Amit,
Assign textaresvariable with empty string & Apply two way binding for all you inputs fields and concate the string with textaresvariable. Please refer two way binding here,
https://www.knowledgehut.com/blog/web-development/two-way-binding-in-angular