1

I have created a dynamic reactive form using which I can add or delete fields dynamically, everything is working fine. When I click on the below + sign, I get the result as -

I want to remove the Radio Button (And / Or ) from the last row always like if it's 3 rows, I want only for 1st and 2nd, it should not come up for third. I tried a lot but I am not able to achieve it.

Can someone please help?

1
  • You decided to remove most of the information from your question which enabled users to answer it. You have insisted on doing that after a user undid that. Please reconsider. For one, this makes the question a moving target, i.e. it invalidates existing answers. Removing the info needed to get answers from other users is not appreciated. For another, questions like this lack focus on the specific problem which is only visible in the removed information, that makes it off-topic. Please re-add the info. Commented Jun 1, 2021 at 5:33

1 Answer 1

1

just use in *ngFor, let last=last and a *ngIf="!last" see the docs

<div formArrayName="example"
      *ngFor="let a of exampleForm.get('example').value; 
      let i = index ;
      let last=last;  <!--add the let last=last-->
      trackBy: trackByFn">
   ...
   <div class= "operators" *ngIf="!last">
     ...
   </div>
 </div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.