Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
49 views

I having issue multiple validation is not working properly. For example validate1 method checking input is empty or not , validation2 method checking name1 and name2 value are equal or not equal. ...
Angular Guru's user avatar
1 vote
1 answer
61 views

Currently I am created two directive to project . But one directive useed for if checkbox is checked , I will get 1, if checked is false i will get 0. Another Directive is used for convert value &...
Angular Guru's user avatar
1 vote
1 answer
71 views

Given the following code snippet: @Component({ selector: 'app-editor', templateUrl: './editor.component.html', styleUrls: ['./editor.component.scss'], providers: [{ provide: ...
user1169587's user avatar
  • 1,448
1 vote
2 answers
75 views

I have a form: <input type="password" id="password" name="password" ngModel #password="ngModel" ...
user28273827332's user avatar
1 vote
1 answer
46 views

I'm trying to setup the form in such a way that when someone selects Mr in the first dropdown, the value changes to male in the second dropdown. Likewise, if someone chooses Miss/Mrs, the 2nd dropdown ...
Elaine Byene's user avatar
  • 4,163
2 votes
1 answer
52 views

<select [(ngModel)]="profile.type" name="type"(change)="selectPhoneType($event,mailCreate,'phone4_Value')"> <option value="">...
user3653474's user avatar
  • 3,872
0 votes
2 answers
151 views

I'm trying to give user the ability to update the quantity of their selection before product checkout. The code below allows only 1 character in the textbox. What changes can I make to allow user ...
Blah Foo's user avatar
2 votes
1 answer
50 views

My requirement is to fill textboxes with their corresponding value from database when a change is made in name textbox. For instance, if the value Mary is enter in name textbox then its corresponding ...
Milie24's user avatar
  • 89
1 vote
1 answer
3k views

I have the above error message when I try to use two-way binding in a Angular application. <form> <input type="email" class="form-control" id="email" name="...
Collina's user avatar
  • 75
1 vote
0 answers
172 views

I have a weird behavior with async validators from Angular. Here's the context (this is an example, not the best use case here but that's not the issue ^^) : I have a form with a ngModelGroup inside. ...
Jesc6417's user avatar
0 votes
1 answer
335 views

I have a template-driven form in my Angular application that includes a dropdown menu (select element). I want to validate the dropdown menu to ensure that a value is selected before the form is ...
Tom N's user avatar
  • 1
0 votes
1 answer
586 views

I have a fix number of checkbox which I am binding using for loop. <ul> <li *ngFor="let chk of checkboxes"> <input type="checkbox" [id]="chk.id"...
j4rey's user avatar
  • 2,707
0 votes
0 answers
682 views

here i am using template forms for binding the values under array and there is inline edit available for each row, issue is that, if i am giving duplicate for 3 rows under order number or the name, it ...
Bhrungarajni's user avatar
  • 2,547
2 votes
1 answer
165 views

I have a very simple Angular Component as follow: import { Component } from '@angular/core'; @Component({ selector: 'test-view', template: ` <div [ngStyle]="{ 'background-color': m....
Ciaccia's user avatar
  • 402
3 votes
0 answers
319 views

I have "FormWrapper" Component like that <form [formGroup]="wrapperForm"> <ng-content></ng-content> </form> and AppComponent like that: <app-form-...
Beshoy Fayez's user avatar
1 vote
1 answer
325 views

I need to refer my form to do some think. This my hmtl code is: <form #formField="ngForm"> <div class="row"> <div class=&...
Picco's user avatar
  • 461
0 votes
0 answers
537 views

I need to show the result in second component, the first component is rendered in the second component at the same time i need the user input value to be displayed in the second component for further ...
Rishf P's user avatar
  • 49
0 votes
0 answers
1k views

I want to have two forms on a page, each with their own submit button and validation. However, when I try and submit the 1st form the validation for the 2nd form triggers (and vice versa). Is there a ...
Chet's user avatar
  • 199
0 votes
2 answers
4k views

my purpose is show an error when the user doesn't put a value. I know that above example doesn't have a lot of sense, but I don't read the error also if the programs must show. the code is this: <...
Picco's user avatar
  • 461
1 vote
0 answers
1k views

I'm trying to use mat-select of Angular Material 11.2.12. Since I need to make mat-select do some stuff (filter, select/deselect all) besides its default behavior, I need to put it inside a component ...
Matt's user avatar
  • 375
1 vote
1 answer
143 views

I have a form where are sub categories and save button calls mat-error correctly for all the fields in all categories in once correctly if nothing entered. But I also have add button for each category ...
Shubham Shaw's user avatar
0 votes
1 answer
617 views

I have multiple angular forms which are generated inside a ngFor loop as follows. and each form is a wizard step which a user can move forward by completing the form individually. in the form input ...
KATJ Srinath's user avatar
1 vote
0 answers
1k views

since I use several similar mat-inputs inside a template form, I define an ng-template for these mat-inputs and refer to it via *ngTemplateOutlet and also pass related data to the template as bellow: ...
R. Nourmandi's user avatar
3 votes
2 answers
5k views

Im trying to build a form wherein you can create another field of input on clicking an add button. The problem is that same value gets populated for each row input. As you can see from the below image,...
Jijo Robin's user avatar
2 votes
2 answers
4k views

When my Angular component HTML renders. I will get lots of errors that look like this ERROR TypeError: Cannot read properties of undefined (reading 'someProperty') In my HTML page, I have lots of ...
chuckd's user avatar
  • 14.8k
0 votes
2 answers
913 views

While working with validating same radio input elements with two different approaches viz. template-driven-form and model-driven-form, I am stuck with the scenario where for template-driven-form, ...
Aakash Goplani's user avatar
0 votes
0 answers
236 views

I'm trying to make a form like this; <form #testForm="ngForm" (ngSubmit)="onSubmit(testForm)" novalidate> <!-- X-Value --> <div ngModelGroup="xValue&...
Steve Chacko's user avatar
2 votes
1 answer
975 views

Just like the title says, if I wrap an input in my custom component, it's not being picked up by Angular's template form. Here's the stackblitz Here's some code from StackBlitz app.component.html <...
roman m's user avatar
  • 26.6k
1 vote
1 answer
1k views

If I open the form and change the input field 'city' and click cancel. After that if I open the form again, the defualt value is changed. How to get that default value in the form field? component ...
sundar_147's user avatar
0 votes
0 answers
253 views

<nb-select [(ngModel)]="selectedOption" (click)="getProdDetails(p.ProductName,p.Brand)" ngDefaultControl> <nb-option [value]="p.Size" class="text-...
user16348035's user avatar
0 votes
1 answer
111 views

there is a template-driven form and within this form, there is a dropdown. I want to show data from the backend to the dropdown. Here data is coming from the backend in appliesWhenData. <form #...
Karan Gupta's user avatar
0 votes
1 answer
1k views

Two way binding in angular 9 form I tried using [(ngmodel)] in form but it gives error This is depricated in angular 6 and above versions
anony's user avatar
  • 1
2 votes
2 answers
9k views

I am trying to create a forum within my website. After struggling to implement using template driven forms, I decided to switch to Reactive forms. I have been switching between the two approaches ...
breadman0's user avatar
  • 323
0 votes
1 answer
492 views

I have the following angular template form : <label for="operationType" class="form-control">Operation</label> <select name="operationType" [(...
Mahamane's user avatar
4 votes
1 answer
2k views

I have read a lot of articles about the differences about the 2 types of forms in angular but nowhere found practical examples. So, if I have a table, and only a checkbox to select rows, is there any ...
Michalis's user avatar
  • 7,006
1 vote
0 answers
248 views

I am using mat error in the below way <mat-form-field appearance="outline"> <input matInput [ngModel]="_control.control.value" (...
Hacker rocker1169's user avatar
0 votes
1 answer
186 views

I use template driven input and can not get its value in unit test unlike of reactive input. Here are two same components one implemented with template driven approach and anoter one with using of ...
MrDiemath's user avatar
3 votes
1 answer
2k views

I have a template driven form in my angular 10 app that I am trying to listen for changes to so that I can show an 'changed, please submit updates' message to the user. HTML <form (ngSubmit)="...
GrahamJRoy's user avatar
  • 1,653
2 votes
1 answer
268 views

Hello guys? how can i Validate #permissionInput if there's a value, btw this is angular. <input #permissionInput type="text" ...
Nine's user avatar
  • 51
2 votes
3 answers
4k views

I am working on Angular 10. Its been 3 days that I have a problem with angular template-driven and reactive forms. What I want to do: Create a complex form with many child components (in order to ...
MMario's user avatar
  • 35
3 votes
1 answer
2k views

I'm trying to create a custom component (a customized autocomplete field) but I want to work for both reactive forms and template forms So sometimes the value will come through [(ngModel)] and ...
Dany Y's user avatar
  • 7,091
3 votes
2 answers
5k views

I want to manually set the EmployeeForm as Invalid from the .ts file. Here EmployeeForm is a Template driven form. I have tried to do the following but it didn't work. this.EmployeeForm.setErrors({ '...
Dev's user avatar
  • 567
0 votes
1 answer
962 views

i have template ref modal with template driven form inside it. when i submit the form, all form value gets printed on url http://localhost:4200/admin/users?userName=test&[email protected]&...
conrad's user avatar
  • 106
0 votes
1 answer
2k views

I have a Template driven form in angular, on which i want to populate valuees when i click on a product. The fields 'description' and 'imageUrl' might be undefined which break my form if i don't take ...
Alain Duguine's user avatar
0 votes
1 answer
1k views

On selecting a particular item from this open dropdown I want the textboxes to be shown in the form Each of these dropdown value has certain properties which are being fetched from database. This is ...
Dev's user avatar
  • 567
0 votes
0 answers
581 views

I need to write the custom validator for the Angular template-driven form where one any non-empty input would be sufficient to make the form valid. Consider the following Angular form with the two ...
igortche's user avatar
  • 115
0 votes
0 answers
410 views

Whenever I am using ngModel with id it gives an error. If I don't use this then it shows an error that invalid is not any property. Please tell me where I am going wrong. <form #loginform="...
Mahak Garg's user avatar
0 votes
1 answer
2k views

I would like to have a default value shown with a mat-select in a stepper from Angular material. [Edit] you cannot use formControlName with two-way binding. I ended up initializing the value in the ...
Christopher You's user avatar
1 vote
1 answer
2k views

I am learning Angular on Pluralsight and I have a question regarding a course I am taking currently. I am confused on the reasoning behind template reference variables when they are assigned a value. ...
PhillyD's user avatar
  • 175
0 votes
1 answer
815 views

I am new to angular so still learning it, it might be simple use case but so far i have been trying to implement it but unable to do it so asking here. I am making an http requests and based on the ...
user avatar