Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1816] JSS files and require seems to conflict on Android

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2013-04-02T23:35:43.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, core, jss
Reporterjohn q hiu
AssigneeMauro Parra-Miranda
Created2012-10-24T18:09:01.000+0000
Updated2016-03-08T07:40:43.000+0000

Description

It seems to be a problem with the use of require() In this example only the styles from jss is applied to the window and not to the label. *app.js* {quote}
 

var NewLabel = require('NewLabel');
var label = new NewLabel();
var win = Ti.UI.createWindow({
    id : 'mainwin'
});
win.add(label);
win.open();
*NewLabel.js*
 

function NewLabel() {
    var label = Ti.UI.createLabel({
        id : 'ptlabel'
    });
    return label;
};
module.exports = NewLabel;
*app.jss*
 

#mainwin {
    background-color: '#f00';
}
#ptlabel {
    color:'#fff';
    top:10;
    width:'auto';
    height:'auto';
    text:'I am Android!'
}

Comments

  1. Pedro Enrique 2013-04-02

    The label in on a different file and the JSS file needs to be called the same as the JS file. Also, JSS was created for when we used the window "url" and it is not mean to be used with CommonJS modules.
  2. Mauro Parra-Miranda 2013-11-24

    Invalid issue.

JSON Source