Looking to trigger a function in TypeScript from the view using AngularJS. My technology stack includes AngularJS, TypeScript, and ASP.Net MVC3.
Here is the link in the UI:
<div id="left_aside" ng-controller="MyGivingPortfolioController">
<div class="charity_portfolio_tile" ng-repeat="Tile in VM.Tiles.TileContainerEntity" >
<a href="#" ng-click="Delete(Tile.Id)" class="delete_button">delete</a>
</div>
When clicking this link, the method does not get invoked.
Delete = function (Id:number) {
alert("Called " + Id.toString());
}
Attempting to make changes to the function:
Delete(charityID: number) {
var id = charityID;
alert(id.toString());
}
Despite these adjustments, the function still does not work. I am unsure of the reason for this issue.
class MyController implements IMyController {
Tiles: TileContainerEntities;
constructor($scope, $http: ng.IHttpService) {
$scope.VM = this;
$http.get("/API/PrivateAPI/Test/1").success((responce) =>{this.BusinessReponseList = responce; });
}
Delete = function (Id:number) {
alert("Called " + Id);
}
//Delete(charityID: number) {
// var id = charityID;
// alert(id.toString());
//}
Would appreciate any insights on how to resolve this issue.