Balu Balu - 2 years ago 65
AngularJS Question

Issue while adding controls dynamically

I was adding and removing controls dynamically. However, I have a small requirement.

Below one is Jsbin code.,output

  1. Open the link.

  2. Click “Adperson”

  3. Now click Remove two times.

Observe, all control are removed and then you are not allowed to add controls.

My page should have at least one set of controls.


Answer Source

You can simply do:

  $("#associationRemove").on("click", function(){
      if($(".cloneMe").length > 1){
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download