Monday, 24 April 2017

Node.js - Handlebars Referencing Variable

In a handlebars view - is there a way to reference an objects key that has a space in it? The key is "Record Number" in the object, but I can't seem to be able to reference it in the view. For instance - I have the following code in the view:


                    


The array "records" from the controller:

records = [
    {
        'Record ID':3
    },
    {
        'Record ID':3
    }
];

The error I am getting:

 Expecting 'ID', got 'STRING'

I have also tried "this['Record Number']" with the same error.



via Jim M

No comments:

Post a Comment