Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Why can I not assign a function to a window/view?

$
0
0

Hi, I am trying to assign a function to a window/view which I want to call later. But when I output stringified object the function does not appear. I can assign an integer value but not a function. Why not?

I tried with a new template project!

var dummy=function() {};
 
var view = Alloy.createController('test').getView();
console.log(JSON.stringify(view));
view.gameStatus=dummy;
console.log(JSON.stringify(view));
Output: {"horizontalWrap":true,"id":"test"} {"horizontalWrap":true,"id":"test"}

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>