meteor-jade icon indicating copy to clipboard operation
meteor-jade copied to clipboard

#{} syntax does not work correctly when calling a helper with arguments

Open halgorithm opened this issue 10 years ago • 7 comments

Tested with Meteor 1.0.2.1 and mquandalle:jade 0.4.1:

main.jade

head
  title Example

body
  +example

example.tpl.jade

p A1: {{myHelper}}
// "A1: arg is undefined"

p A2: #{myHelper}
// "A2: arg is undefined"

p B1: {{myHelper 123}}
// "B1: arg is 123"

p B2: #{myHelper 123}
// "B2: #{myHelper 123}"

example.js

if (Meteor.isClient) {
  Template.example.helpers({
    myHelper: function(arg) {
      return "arg is " + arg;
    }
  })
}

halgorithm avatar Jan 07 '15 21:01 halgorithm

I have just observed this as well ;-(. The Spacebars syntax {{helper arg}} works fine, but the Jade syntax #{helper arg} does not work.

dgtlife avatar Jan 17 '15 12:01 dgtlife

I have same bug.

focused avatar Apr 19 '15 13:04 focused

+1

logankoester avatar May 06 '15 01:05 logankoester

+1

maioral avatar Jun 01 '15 18:06 maioral

+1

dalgard avatar Sep 02 '15 22:09 dalgard

+1

mickdekkers avatar Oct 14 '15 00:10 mickdekkers

I've modified a fork of this package to support the missing syntax, requested in this thread, together with a few other important features. The fork has been released as dalgard:jade.

I will keep the new package in sync with the original, should there be any updates, but generally continue maintenance until the two packages can hopefully be merged, if/when mquandalle:jade gets revived at some point.

dalgard avatar Oct 14 '15 09:10 dalgard