I have a tier div which contains number of elements like drop-down textbox . when I click on add tier this div needs to create again and again on every button click as well as the name should be changed to tier1 tier2 tier3
Please let me know in angular2
--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



Hello,You can create array of tier where each element of array represents one tier and stores values of drop-down and other elements of that particular tier. So when you click on button to add one more tier to existing, you can add new element of tier and add it in list.For Example,In html code,
<button (click)="addTier()">Add Tier</button><div *ngFor="let tier of tiers">
<input [(ngModel)]="tier.title" name="title">
<!-- your elements-->
</div>
In ts code,
tiers: TierProto[] = [];
addTier(){this.tiers.push(new TierProto());}
Model of TierProto,
class TierProto{title: string;}
On Wed, Jun 13, 2018 at 10:50 PM Alekhya Pulavarthi <lakshmia...@gmail.com> wrote:
I have a tier div which contains number of elements like drop-down textbox . when I click on add tier this div needs to create again and again on every button click as well as the name should be changed to tier1 tier2 tier3
Please let me know in angular2
--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.