【问题标题】:Fill Grid Using Type Script Controller使用类型脚本控制器填充网格
【发布时间】:2015-08-17 23:26:59
【问题描述】:

我已经使用 typescript 和 angular js 实现了一个控制器,并且还获取了数据作为响应,但是当我尝试将这些数据与我的网格绑定时出现了一些问题。我已经使用了 ng-repeater。

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

ng-controller="CustomerCtrl as custom"

我试图在我的控制器中访问它:-

 ng-repeat="cust in custom.cust_File

 Full Name: {{cust.Name}}

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

【问题讨论】:

  • 尝试将您的属性放在类级别而不是 $scope 上,因为您视图中的自定义内容将是 CustomerCtrl。如果你保持原样,我认为你的 ng-repeat 应该是 ng-repeat="cust in custom.$scope.cust_File"。

标签: angularjs typescript typescript1.4 typescript1.5


【解决方案1】:

如@hugues Stefanski 所述,我通过在 custom.$scope.cust_File 中使用 cust 解决了这个问题。 非常感谢....

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-26
    相关资源
    最近更新 更多