Not sure what I am doing wrong here but not getting far.
I have created a class using Coffeescript:
# CoffeeScript
App=
Title:""
TopMenu:[]
AddTopMenu:(title,count,icon)->
Record=
Title:title
Icon:icon
Count:count
AddSubMenu:(title,icon,count) ->
Title:title
Icon:icon
Count:count
Output:
(function() {
var App;
App = {
Title: "",
TopMenu: [],
AddTopMenu: function(title, count, icon) {
var Record;
return Record = {
Title: title,
Icon: icon,
Count: count,
AddSubMenu: function(title, icon, count) {
return {
Title: title,
Icon: icon,
Count: count
};
}
};
}
};
}).call(this);
The question is, how to call App.Title or App.AddTopMenu?
I have tried the following:
<script>
App.Title="asdasd";
</script>
<script>
var test = new App();
test.Title="asdasd";
</script>
Without luck, cannot find App.
Any help would be great.
Paul