Default object

71 views
Skip to first unread message

bruno....@gmail.com

unread,
Jul 10, 2009, 4:45:57 PM7/10/09
to Embedded JavaScript
Hi there,

Thaks for this lib. I´m integrating some php frameworks here for our
company architecture and I found EJS on the net. Since I use
jsonschema for defining my calls it´s a very nice toll I can use. When
I define an json schema type, it can be an "simple" type, an array, an
object, etc...


But I only see a way of passing objects to ejs. Is there a way to pass
an array and loop through it, without having to create an extra object
arround it ? It would be very nice to have something like a root value
to use on this cases. That is a small detail, but it represents a lot
to me in terms of responsability of the layers. Why? Because I get
data from the server, send it to the view and the view knows how to
show it. In this point of view, the view is the only responsible to
know the data type.

Is there a way to get this root data?

Justin Meyer

unread,
Jul 10, 2009, 4:51:04 PM7/10/09
to embeddedj...@googlegroups.com
yes, pass in anything you want.  You can refer to it with this.  At least you can w/ JMVC.


Justin Meyer

Jupiter IT Solutions
847-924-6039
justin...@gmail.com
AOL: jusbarmey

Bruno Reis

unread,
Jul 13, 2009, 8:41:55 AM7/13/09
to embeddedj...@googlegroups.com
Thanks,

worked fine with this.data....

EjsView.prototype.partial = function(options, data){
  if(!data) data = this.data;
  return new EJS(options).render(data);
--
Ats,
Bruno Prieto Reis
Gerente de Projetos em TI
Gradua Networks
Reply all
Reply to author
Forward
0 new messages