ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

[Bug] (modifier) does not accept values

Open NullVoxPopuli opened this issue 4 years ago • 2 comments

🐞 Describe the Bug

Probably related to : https://github.com/emberjs/ember.js/issues/19869

but (helper aHelper) and (component aComponent) work for currying values, but (modifier) only takes strings.

(modifier) should take values for pairity with helper and component.

🔬 Minimal Reproduction

https://github.com/NullVoxPopuli/curried-things-test

😕 Actual Behavior

An error occurs

🤔 Expected Behavior

A curried modifier is returned

🌍 Environment

  • Ember: - ~3.28.0
  • Node.js/npm: - n/a
  • OS: - n/a
  • Browser: - n/a

➕ Additional Context

Add any other context about the problem here.

NullVoxPopuli avatar Dec 05 '21 17:12 NullVoxPopuli

I gave your reproduction a try and I think the problem is that a plain function is used as the modifier value which won't work without your default modifier manager RFC. If you wrap that function in the ember-could-get-used-to-this`s modifier function it works as expected.

In fact, Ember already warns you about this with an error in the console:

Uncaught Error: Expected a dynamic modifier definition, but received an object or function that did not have a modifier manager associated with it. The dynamic invocation was `{{@myModifier}}`, and the incorrect definition is the value at the path `@myModifier`, which was: (unknown function)

Windvis avatar Feb 15 '22 08:02 Windvis

I'll have to try this again with https://github.com/NullVoxPopuli/ember-functions-as-modifiers-polyfill

NullVoxPopuli avatar Feb 15 '22 11:02 NullVoxPopuli