From 9096afd1c0fcfe31a9496381adcc1ba137cd1194 Mon Sep 17 00:00:00 2001 From: jasonkneen Date: Fri, 12 May 2017 06:59:26 +0100 Subject: [PATCH] Simulate fetch for mock collections --- reste.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reste.js b/reste.js index e95e71a..4be3f7a 100644 --- a/reste.js +++ b/reste.js @@ -410,7 +410,12 @@ var main = function() { } if (content instanceof Array) { + // on-the-fly collection, so populate from array Alloy.Collections[name].reset(content); + // and override fetch to trigger a change event + Alloy.Collections[name].fetch = function(){ + Alloy.Collections[name].trigger("change"); + }; } else { throw "No Array specified for createCollection"; }