-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Before filing issues, please check the following points first:
- Please don't open issues for security issues. Instead, file a report at https://www.npmjs.com/advisories/report?package=handlebars
- Have a look at https://github.com/handlebars-lang/handlebars.js/blob/master/CONTRIBUTING.md
- Read the FAQ at https://github.com/handlebars-lang/handlebars.js/blob/master/FAQ.md
- Use the jsfiddle-template at https://jsfiddle.net/4nbwjaqz/4/ to reproduce problems or bugs
This will probably help you to get a solution faster.
For bugs, it would be great to have a PR with a failing test-case.
SERIOUSLY??
<section id="presidents">
{{#each data}}
<figure class="president">
{{#if this.name = "John Adams"}}
<img src="https://commons.wikimedia.org/wiki/File:John_Adams_A18236.jpg" alt={{this.name}} />
<caption>{{this.name}}</caption>
{{else}}
<img src={{this.photo}} alt={{this.name}} />
<caption>{{this.name}}</caption>
{{/if}}
</figure>
{{/each}}
</section>
Error: /Users/studio/GeneralAssembly/Mod2_React_Express/sandbox/SomeSite/views/presidents.hbs: #if requires exactly one argument
at Object. (/Users/studio/GeneralAssembly/Mod2_React_Express/sandbox/SomeSite/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js:17:13)
at Object.wrapper (/Users/studio/GeneralAssembly/Mod2_React_Express/sandbox/SomeSite/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)
at eval (eval at createFunctionContext (/Users/studio/GeneralAssembly/Mod2_React_Express/sandbox/SomeSite/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), :11:47)
at prog (/Users/studio/GeneralAssembly/Mod2_React_Express/sandbox/SomeSite/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/runtime.js:268:12)
at execIteration (/Users/studio/GeneralAssembly/Mod2_React_Express/sandbox/SomeSite/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:51:19)
at Object. (/Users/studio/GeneralAssembly/Mod2_React_Express/sandbox/SomeSite/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:61:13)
at Object.wrapper (/Users/studio/GeneralAssembly/Mod2_React_Express/sandbox/SomeSite/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)
at Object.eval [as main] (eval at createFunctionContext (/Users/studio/GeneralAssembly/Mod2_React_Express/sandbox/SomeSite/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), :11:49)
at main (/Users/studio/GeneralAssembly/Mod2_React_Express/sandbox/SomeSite/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/runtime.js:208:32)
at ret (/Users/studio/GeneralAssembly/Mod2_React_Express/sandbox/SomeSite/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/runtime.js:212:12)