typescript - ng-click not triggering Angularjs -


i need call function in type script view using angular.js. technologies use angular.js typescript , asp.net mvc3.

this link in 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 click link doesnt invoke method.

 delete = function (id:number) {     alert("called " + id.tostring()); } 

then changed function below.

delete(charityid: number) {     var id = charityid;     alert(id.tostring()); } 

though changed code, didn't work. don't know reason this.

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()); //} 

}

does know how so?

modify href's ng-click ng-click="vm.delete(tile.id)"

i.e.:

<div class="charity_portfolio_tile" ng-repeat="tile in vm.tiles.tilecontainerentity" >       <a href="#" ng-click="vm.delete(tile.id)" class="delete_button">delete</a> </div> 

just useful info not directly related answer: aware of scope inheritance : http://youtu.be/wdtvn_8k17e?t=5m34s . ng-repeat creates new scope :)


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -