I have a requirement in my project where the user can provide some information such as maybe some name and URI using the modal. They have the option to enter as much name and URI as they want and each would be displayed in the front-end table and each of these information will have a modify and delete button which they can use to modify or delete each of the provided entries individually. I am capturing the URI and name from the modal and writing them into an array and then looping through the array in HTML to display each element which is as of now working fine. I want to now create 2 buttons for showing next to the text so that on click they can modify and delete but I am unable to create the button from AngularjS. I have previously created these buttons using the Jquery but now sure why its not working in AngularJS.
AngularjS
:
$scope.ExtensionList = [{}];
$scope.ExtensionVlaues = 0;
$scope.AddNewExtension = function(){
var ExtensionText = $scope.AddExtensionForm.AddExtensionNamespaceURI+':'+$scope.AddExtensionForm.AddExtensionLocalName;
var DeleteOption = angular.element('<button title="Delete Extension" type="button" value="Delete_Extension" name="DUMMY" class="btn btn-info btn-xs edit_data" id="' + $scope.ExtensionVlaues + '"><span class="fa fa-pencil-square-o fa-xs" aria-hidden="true"></span></button>');
$scope.ExtensionList.push({ExtensionText: ExtensionText, DeleteOption: DeleteOption});
}
HTML Page
:
<tr ng-repeat="extension in ExtensionList" ng-show="ShowExtensionList">
<td class="form-inline">
<span>
{{ extension.ExtensionText }}
</span>
<span>
{{ extension.DeleteOption }}
</span>
</td>
</tr>
I am getting the following output when I tried this: (AD:F is created by the ExtensionText from above)
AD:F{"0":{},"length":1}