Button to delete form if only it is not filled

Asked

Viewed 37 times

0

I have a button that add new locations Forms. I would like to know how to delete the form if you have added it will not be filled.

I created this link to delete the fields.

<div class="col-12 text-center">
  <div class="link_company blue underline_hover pointer" (click)="removeLocation()" i18n>Remover campos</div>
</div>

1 answer

0

<div class="col-12 text-center">
  <div class="link_company blue underline_hover pointer" (click)="removeLocation()" i18n>Remover campos</div>
</div>

make a function that is called when the form is sent, like a validation where the logical test.

if($(".col-12 text-center") == ''){
  removeLocation();
}

kind of like that got it?

  • Not quite that, I need to create the removeLocation() function on a Component.ts.

  • If the form is Dirty the div to remove field will not be visible, if it is pristine div will be visible to remove field

Browser other questions tagged

You are not signed in. Login or sign up in order to post.