Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1525] Alloy Binding without persistence doesn't seem to work anymore

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionWon't Fix
Resolution Date2016-11-04T17:54:49.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsModels
Labelsalloy, bindings, samples
ReporterThomas Wiesen
AssigneeFeon Sua Xin Miao
Created2016-10-05T14:33:04.000+0000
Updated2016-11-08T10:58:53.000+0000

Description

The sample app * https://github.com/appcelerator/alloy/tree/master/test/apps/models/binding_no_persistence fails with the error * TypeError: Cannot read property '__transform' of undefined (Android) and * TypeError: undefined is not an object (evaluating '$model.__transform') (iOS) respectively. Does this mean that it is no more possible to use Alloy Binding without persistence?

Attachments

FileDateSize
binding_no_persistence.zip2016-10-05T16:01:49.000+00007006

Comments

  1. Sharif AbuDarda 2016-10-05

    Hello, I can't access the sample app page. Can you attach the file in here for us to test? Thanks.
  2. Thomas Wiesen 2016-10-05

    I think I didn't add the link properly, sorry. Try this: [https://github.com/appcelerator/alloy/tree/master/samples/apps/models/binding_no_persistence] I also added the sample in question as a zip file.
  3. Feon Sua Xin Miao 2016-11-04

    [~twiesen], binding without persistence still works. You just need to create the model files under app/models with no adapter type. E.g.
       // app/models/appState.js
       exports.definition = {
       	config: {
       		"defaults": {
       			counter: 1,
       			color: '#00f'
       		}
       	},
       	extendCollection : function(Collection) {
       		_.extend(Collection.prototype, {
       
       			// For Backbone v1.1.2, uncomment this to override the fetch method
       			/*
       			fetch: function(options) {
       				options = options ? _.clone(options) : {};
       				options.reset = true;
       				return Backbone.Collection.prototype.fetch.call(this, options);
       			},
       			*/
       		});
       		return Collection;
       	}
       }
       
  4. Thomas Wiesen 2016-11-08

    Thank you so much! I wasn't aware of this change and I couldn't find it documented anywhere.

JSON Source