I am encountering an issue while integrating my AngularJS code with TypeScript as my ng-click function is not functioning properly. Below is my controller code:
module CustomerSearch.controllers {
export class CustomerCtrl {
static $inject = ['$scope', '$http', '$templateCache'];
constructor(protected $scope: ICustomerScope,
protected $http: ng.IHttpService,
protected $templateCache: ng.ITemplateCacheService) {
$scope.search = this.search;
}
public search = (search: any) => {
debugger;
var Search = {
AccountId: search.AccountId,
checkActiveOnly: search.checkActiveOnly,
checkParentsOnly: search.checkParentsOnly,
listCustomerType: search.listCustomerType
};
this.$scope.customer = [];
this.$scope.ticket = [];
this.$scope.services = [];
var url = "someUrl"; // '<%=ResolveUrl("API/Search/PutDoSearch")%>'
this.$http.put(url, Search).
success((data, status, headers, config) => {
debugger;
this.$scope.cust_File = data[0].customers;
this.$scope.ticket_file = data[0].tickets;
this.$scope.service_file = data[0].services;
}).
error((data, status) => {
console.log("Request Failed");
});
}
}
angular.module("CustomerSearch").controller("CustomerSearch.controllers.QuickSearchController");
}
I am attempting to invoke my TypeScript class using ng-click, but it seems that there may be a problem causing the ng-click event to not be processed correctly.