Getting issue with binding value while passing Event parameter from Template to Typescript Button click event.
See below object, its binding but it not reflecting same to the Typescript controller..
What it should be reason?
Code: Get Order template
<table class="table table-bordered">
<tr>
<td>ID </td>
<td>Name</td>
<td>Price</td>
<td>Action</td>
</tr>
<tr ng-repeat="order in vm.addNewOrderData track by $index">
<td><label>{{order.orderID}}</label> </td>
<td><label>{{order.orderName}}</label> </td>
<td><label>{{order.orderPrice}}</label> </td>
<td><label> <a href="javascript:void(0);" ng-model="editobj" ng-click="vm.edit('{{order.orderID}}');">Edit</a></label> </td>
</tr>
</table>
below is GetOrderController.ts
class GetOrderController {
public vm: any;
private scope: any;
public addNewOrderData: any;
public http: any;
public location: any;
constructor($http: any, $scope: any, $location:any) {
this.scope = $scope;
this.scope.vm = this;
this.http = $http;
this.location = $location;
$http.get("/api/SampleApi/GetAllOrder").success(
(data, status) => {
if (data != "null") {
this.addNewOrderData = data;
}
}).error((data, status) => {
this.addNewOrderData = data;
});
}
edit = (id: any): void => {
debugger;
var order = { OrderID: id };
this.http.get("/api/SampleApi/GetOrderById",id
).success(
(data, status) => {
if (data != "null") {
this.location.path('/saveOrder?id=' + order);
}
else {
alert("No order id found!");
}
}).error((data, status) => {
});
}
}

