{#Lodge}{#Rooms}{LodgeId}{/Rooms}{/Lodge} will work. It will display
LodgeId of all rooms.
You can try it in http://www.dustjs.com/ with the JSON object
On Saturday, June 6, 2015 at 5:25:35 AM UTC-7, ryandesign wrote:
>
> On Jun 5, 2015, at 9:40 PM, JBD wrote:
>
> > I have JSON object called Lodge, the start of which is like this:
> >
> > [ { LodgeId: 12,
> > HasInventory: true,
> > Rooms:
> > [ { Room: { Name: { invariant: 'Queen Test' }, Id: 100, Culture:
> null },
> > LodgeId: 12,
> > NightlyRates: null,
> > NightlyRateErrors: null,
> >
> > .... etc
> >
> > As you can see, it's an array with no name. How do I display for
> example the LodgeId?
> >
> > I tried this but it doesn't work, displays nothing:
> {#Lodge}{#.}{LodgeId}{/.}{/Lodge}
> >
> > What am I doing wrong? Thanks.
>
> I don't know dust syntax, but what you have there is an array, not an
> object. To refer to the LodgeId of the object in the first array element,
> in JavaScript, you would write:
>
> Lodge[0].LodgeId
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/9c8dde5f-0fd1-440f-a499-647e2d7770fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.