0

i exported some of my variable an a function in nodejs like below:

app.js:

var setting;
var savesetting = function(val, callback){ .....}
module.export =setting;
module.export = savesetting;

index.js:

var appjs = require('app');
appjs.savesettings(0,1);

appjs.savesettings(); cause an error which is:

Express
500 TypeError: Object #<Object> has no method 'savesettings'

any idea?


Yes, you can to this on some devices. It's especially useful on the Nexus 10 because it has a large screen and a really high density. You can use ADB to force it to emulate other resolutions and display densities. It's perfect for testing alternate layout and drawable resources.

For instance, you could force it to behave similar to a G1 by doing this:

adb shell am display-size 640x480
adb shell am display-density 160

Make sure the screen is turned off when sending these commands and clear them by replacing the size/density with "reset"

adb shell am display-size reset
adb shell am display-density reset

https://plus.google.com/+AdamWPowell/posts/cz5TxuoNDfG

4

1 回答 1

1
var app = {
   setting:{},
   savesetting : function(val, callback){ .....}
}
module.exports = app;

http://nodejs.org/api/modules.html

于 2013-06-27T19:24:38.167 回答