Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 使用类型脚本控制器填充网格_Angularjs_Typescript_Typescript1.4_Typescript1.5 - Fatal编程技术网

Angularjs 使用类型脚本控制器填充网格

Angularjs 使用类型脚本控制器填充网格,angularjs,typescript,typescript1.4,typescript1.5,Angularjs,Typescript,Typescript1.4,Typescript1.5,我已经使用typescript和angular js实现了一个控制器,并获得了相应的数据,但是当我试图将这些数据绑定到我的网格时,出现了一些问题。我使用了ng repeater 我已在html页面上将我的控制器声明为:- ng-controller="CustomerCtrl as custom" 我正试图通过以下方式在控制器中访问它:- ng-repeat="cust in custom.cust_File 及 Full Name: {{cust.Name}} 我不知道问题到底出在哪

我已经使用typescript和angular js实现了一个控制器,并获得了相应的数据,但是当我试图将这些数据绑定到我的网格时,出现了一些问题。我使用了ng repeater

我已在html页面上将我的控制器声明为:-

ng-controller="CustomerCtrl as custom"
我正试图通过以下方式在控制器中访问它:-

 ng-repeat="cust in custom.cust_File

 Full Name: {{cust.Name}}

我不知道问题到底出在哪里…

我通过在custom中使用cust解决了这个问题。$scope.cust_文件,如@hugues Stefanski所述。
Thanx很多…

尝试将属性放在类级别而不是$scope上,因为视图中的custom内容将是CustomerCtrl。如果您保持原样,我认为您的ng repeat应该是ng repeat=“custom中的cust.$scope.cust\u文件”。