I have This Code
var VisualEditor = angular.module("VisualEditor", ["ngSanitize"]);
VisualEditor.controller('VisualEditorController', function($scope, $sce) {
$scope.Pages = [
$sce.trustAsHtml('<div class="col-sm-12" style="height:3vh;background-color:#adb5b9;"><a class="DeletePage" ng-click="DeletePage($index)">x</a></div><div class="col-sm-12 Text"><p class="Paragraph" contenteditable="true">Write Your Text Here</p></div>'),
$sce.trustAsHtml('<div class="col-sm-12" style="height:3vh;background-color:#adb5b9;"><a class="DeletePage" ng-click="DeletePage($index)">x</a></div><div class="col-sm-12 Text"><p class="Paragraph" contenteditable="true">Write Your Text Here</p></div>')
];
$scope.DeletePage = function(index){
$scope.Pages.splice(index, 1);
};
Problem is
<a class="DeletePage" ng-click="DeletePage($index)">x</a>
which wont work.
How can I delete element from $scope.Pages
when user click on <a class="DeletePage" ng-click="DeletePage($index)">x</a>