Monday 15 June 2015

node.js - node, express, jade: How to create select options from a hash -


I have just started playing with the node, express and thus, I try to do something in the Z template:

  my-options = {"this": "something", "he": "something else", "those": "more Select the key each option, in the "Option" (value = "# {key}") option, (name = "myselection" P> However, I get all these 500 server errors What is wrong with me?  

Updates I have just thought that they can not be included in the variable definitions in Z templates. The type of, my_options hash has to be defined in the related router.js file and passed as a parameter on the appropriate result.render () function.

Your first line should be executing the JS code and 'my-options' is not a valid JS variable name .

No comments:

Post a Comment