Tag: falcor

Falcor – 深嵌套的参考

我正在和Falcor玩,看看我工作的公司是否可以使用它,所以我是一个新手。 我使用模型作为数据源。 这是我的模特: var model = new falcor.Model({ cache:{ currenciesById: { "1": { code: "USD", format: "$" }, "2": { code: "GBP", format: "£" }, "3": { code: "EUR", format: "€" }, "4": { code: "YEN", format: "¥"} }, validCurrencies: { "1": { $type: "ref", value: ["currenciesById", 1] }, "2": { $type: "ref", value: ["currenciesById", […]

为什么不Falcor的setValue()在外部模型上工作?

在本地Falcor模型上使用setValue()时,它按预期工作,但是当模型移动到服务器时,会发生“500(内部服务器错误)”。 下面的例子工作正常(脚本在浏览器中运行) var $ref = falcor.Model.ref; var model = new falcor.Model({ cache: { productsById: { 1: { name: "Product ABC", otherAdd: "something 1" }, 2: { name: "Product 123", otherAdd: "something 2" }, }, _view: [ $ref('productsById[1]') ], _cart: [] } }); model. getValue("_view[0].name"). then(function(response1) { console.log( response1 ); model. setValue("_view[0].name", "Another book"). subscribe(function(response2){ console.log( […]