Angular ng-resource配置与对象绑定?

时间:2015-09-14 09:37:45

标签: angularjs typescript ngresource

这是几个小时我试图想出这个非常简单的问题。 我有绑定到付款对象的ng-model属性(ng-model =“payment.newPaymentLine.method”),如下所示:

<div class="form-group form-inline">
                    <label>Payment Method:</label>
                    <select class="form-control"
                            ng-model="payment.newPaymentLine.method"
                            ng-options="paymentMethod for paymentMethod  in payment.paymentMethods" required></select>
                </div>

我想知道如何配置与该属性绑定的ng-resource,我尝试以下格式(“@ payment.newPaymentLine.method”)但它不起作用:

 classContext.bankRepository = classContext.salesOrderResource(
                    classContext.appConfig.getApiEndPoint(classContext.appConfig.apiPath.payment) + "/:PaymentMethod/banks"
                    , { PaymentMethod: "@payment.newPaymentLine.method" });

btw我正在使用类型脚本1.5

1 个答案:

答案 0 :(得分:0)

I think i have misunderstood ng-resource concept, the parameter should bind to the data object properties not with the context object