Titanium JIRA Archive
Alloy (ALOY)

[ALOY-646] Alloy: Module args on method

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2014-07-07T16:55:53.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsRuntime, XML
Labelsmarkup, module, native
ReporterMads Moller
AssigneeUnknown
Created2013-04-30T08:15:37.000+0000
Updated2018-03-07T22:28:29.000+0000

Description

Hi Tony, Problem: How do we do this with markup:
var instance = Module.createView({
    backgroundColor:"#000",
    options : {
    	tintColor:"#444",
        pageMode : myVariable
    }
});
<test>
  <Module id="myModule" module="my.module" method="createView" backgroundColor="#000" options="???" />
</test>
Suggestion: No method - only module reference and a lazyOnInit (or whatever name :) ) property that not are being called before its run in the controller.
<test>
  <Module id="myModule" module="my.module" lazyOnInit="createView" />
</test>
$.myModule.lazyOnInit({
    backgroundColor:"#000",
    options : {
    	tintColor:"#444",
        pageMode : myVariable
    }
});
Does it make sence? Mads

Comments

  1. Tony Lukasavage 2013-09-25

    Can't you just do this with TSS? The create function you specify in the "method" attribute should make use of any TSS that applies to it.
  2. Eric Merriman 2018-03-07

    Closing as invalid. If this is incorrect, please reopen.

JSON Source