2

I already tried using $compile, but the ng-click inside my div is not working:

var newlist = angular.element($compile("<li ng-click='SelectSkillSet(" + $scope.SelectedSkills[x].skill
            + "," + $scope.SelectedSkills[x].key + ",$index)' ng-style=selected(" + $scope.SelectedSkills[x].key
            + ",$index) id='skill" + $scope.SelectedSkills[x].key + "'>" + $scope.SelectedSkills[x].skill
            + "<div class='prfcncy' id='prof5' ng-style='selectProficiency(5)' ng-click='SetProficiency(5)' style='border:1px #2585C9 solid;width:10px;height:10px;float:right;margin-right:5px;margin-top:5px;'>&nbsp;</div>"
            + "<div class='prfcncy' id='prof4' ng-style='selectProficiency(4)' ng-click='SetProficiency(4)' style='border:1px #2585C9 solid;width:10px;height:10px;float:right;margin-right:3px;margin-top:5px;'>&nbsp;</div>"
            + "<div class='prfcncy' id='prof3' ng-style='selectProficiency(3)' ng-click='SetProficiency(3)' style='border:1px #2585C9 solid;width:10px;height:10px;float:right;margin-right:3px;margin-top:5px;'>&nbsp;</div>"
            + "<div class='prfcncy' id='prof2' ng-style='selectProficiency(2)' ng-click='SetProficiency(2)' style='border:1px #2585C9 solid;width:10px;height:10px;float:right;margin-right:3px;margin-top:5px;'>&nbsp;</div>"
            + "<div class='prfcncy' id='prof1' ng-style='selectProficiency(1)' ng-click='SetProficiency(1)' style='border:1px #2585C9 solid;width:10px;height:10px;float:right;margin-right:3px;margin-top:5px;'>&nbsp;</div>"
            + "</li>")($scope));
        $("#RightList").append(newlist);

The ng-click in li is working but not in the div.

user2756589
  • 431
  • 2
  • 7
  • 18

0 Answers0