var source = "<p>Hello, my name is {{name}}. I am from {{hometown}}. I have " + "{{kids.length}} kids:</p>" + "<ul>{{#kids}}<li>{{name}} is {{age}}</li>{{/kids}}</ul>"; var template = Handlebars.compile(source); var data = { "name": "Alan", "hometown": "Somewhere, TX", "kids": [{"name": "Jimmy", "age": "12"}, {"name": "Sally", "age": "4"}]}; var result = template(data); // Would render: // <p>Hello, my name is Alan. I am from Somewhere, TX. I have 2 kids:</p> // <ul> // <li>Jimmy is 12</li> // <li>Sally is 4</li> // </ul>
Handlebars.js
Đăng ký:
Đăng Nhận xét (Atom)
Is it okay to use both fetchpriority="high" and loading="eager" in img tag?
https://stackoverflow.com/questions/77744344/is-it-okay-to-use-both-fetchpriority-high-and-loading-eager-in-img-tag Yes Fetchpriority and l...
-
letsencrypt "Certbot doesn't know how to automatically configure the web server on this system" (repusic.com) sudo yum inst...
-
https://medium.com/@mair.swartz/creating-xml-document-with-react-c6c37f5c608b I wanted to see if React could be used to compose anything mo...
-
Modify File Permissions with chmod | Linode Modify File Permissions with chmod The chmod command allows users to change read and write per...
Không có nhận xét nào:
Đăng nhận xét