Maybe an explanation of "foo" : { "type" : "foo" } can be explained why "foo" is needed twice? #934

jianlin opened this Issue Jan 17, 2013 · 2 comments


None yet

2 participants


Maybe the Quick Start or the Intro doc can add this -- I think this is true but not entirely sure

In application.json

  "foo" : {
      "type" : "foo"

The first foo becomes a variable, and is useable in a template, such as HandleBars. The second foo is the Mojit name. So we can have

  "bar" : {
      "type" : "foo"

which means the Mojit foo will be evaluated and the content assigned to the variable bar. Is this true? I think the intro docs can mention this. Otherwise some people might wonder, why the repeating for foo twice?

And actually, why use "type" I wonder, can it add a synonym of mojit or use_mojit ? Then it can become:

  "bar" : {
      "use_mojit" : "foo"

Hi jianlin,

We call "bar" a mojit instance that can be used to call actions. These actions can be mapped to routing paths. That information is captured in the "Getting Started":

The intention of the quickstart is to just have the user install Mojito and then create and run an application. The getting started tutorial offers more details about what's going on.

As for "foo" becoming a variable useable in a template--that is only true in the case of using composite mojits, where the parent mojit can execute the child instance and attach the rendered child view to the parent's template. We are working on a more expanded tutorial that will cover composite mojits and the HTMLFrameMojit. Right now, we have a chapter in the "Developer Topics" book on the HTMLFrameMojit and composite mojits and examples.

The "type" property is part of the spec. You can file an enhancement issue to have an alias for "type" if you like.




I'm going to close this issue for now because the getting started discusses mojit instances and routing paths. Thanks.

@zhouyaoji zhouyaoji closed this Jan 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment