Strange problem with dynamically defined mojit

I had a controller where I invoked n number of childMojits using "_disptach". See the code here: https://gist.github.com/akshar100/6087592

[Caridy, if you are looking at this thread look at the line number 25 and you will realize what my problem is]

My child mojits were using "mojito-http-addon". It so happens that this particular addon has a method that looks like following

 getRequest: function() {
return this.adapter.req;

Note that "adapter" is supposed to have only 3 methods: done,error,flush. But without adding the "req" to the adapter all the childMojits would fail.

I have figured out the workaround but I am not happy with it. There has to be a much better way of dynamically defining mojits without worrying about such minor details. Current method seems very clumsy to me.

Above issue needs to be fixed or the documentation needs to be updated. Either ways I think Mojito should have much simpler way of using dynamically defined mojits.

5 Replies

Recent Posts

in Yahoo! Mojito