ng-click doesn't work on links created through jquery append

Viewed 3179

If is use ng-click attribute of angular js script on statis links, it works well code shown below

<div class="modal fade" id="cModal" ng-controller="modalController">
  <li id="modalp1" class="active"><a ng-click="parentOptions()" href="#">Add Parent</a></li>
</div>

If sample link created dynamically through jquery append() or prepend() method, then click event doesnt work. sample code shown below.

$('#cpartners').prepend("<li><a ng-click=\"parentOptions()\" href=\"#\">Add Parents (Mother & Father)</a></li>");

Controller sample code shown below

function modalController($scope) {
  $scope.sthumbEdit = function() {
    $(".dur").show();
  };
  $scope.hthumbEdit = function() {
    $(".dur").hide();
  };
  $scope.parentOptions = function() {
  prepareParentOptions();
  };

  $scope.siblingOptions = function() {
   prepareSiblingOptions();
  };

  $scope.childOptions = function() {
   prepareChildOptions();
  };

}

Is there any way to enforce ng-click attribute works well on dyanmically generated links.

2 Answers
Related