我正在尝试使用 AAngularJs+TypeScript 在页面加载时获取我的所有下拉列表。我已经完成了加载它的实现ng-options
和ng-init
方法,但可能存在一些问题,这就是为什么我无法从我的 API 获取数据或调用我的 API。我已经用这个问题给出了我的代码。
这是我的打字稿控制器:-
/// <reference path="../interface/interface.ts" />
/// <reference path="../../scripts/typings/jquery/jquery.d.ts" />
/// <reference path="../../scripts/typings/angularjs/angular.d.ts" />
module CustomerNew.controllers {
export class CreateCustomerCtrl {
static $inject = ['$scope', '$http', '$templateCache'];
debugger;
constructor(protected $scope: ICustomerScope,
protected $http: ng.IHttpService,
protected $templateCache: ng.ITemplateCacheService) {
$scope.create = this.create;
$scope.getFormData = this.getformData;
}
public getformData: (getFormData: any) => {
$http.get();
}
给出错误 AS 它给出了“预期的属性或签名”和意外令牌的错误。“需要构造函数、方法、访问器或属性”。