Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

injected function not evaluated in undefined parameter #3

Open
mpanichella opened this issue May 7, 2020 · 1 comment
Open

injected function not evaluated in undefined parameter #3

mpanichella opened this issue May 7, 2020 · 1 comment
Labels
bug Something isn't working question Further information is requested stale Has not been progressed in any way for too long

Comments

@mpanichella
Copy link

The problem is with injected function, for example if i have template

model: [
{
"{{#if hasValue(data)}}": {
name: "{{name}}",
},
},
{
"{{#else}}": undefined,
},
],

if data property exists in model, the evaluation work well, but if transform other data, where property "data" not exists, hasValue not evaluated.

@JakubMifek
Copy link
Owner

Thank you @mpanichella for the notice. I will look into that.

If I understand it correctly, you inject hasValue function to the SelectTransform and then run the above model with a data object such as { } and the issue is that hasValue is not called.

It seems to me that it might fail on the fact that data is not defined, also it seems that I handle injections poorly. I will try to take a look at that. Did you try to use this.data instead of just simple data?

Also, would you be that kind and provide me with whole snippet of code and expected outcome?
Thank you :)

@JakubMifek JakubMifek added bug Something isn't working question Further information is requested stale Has not been progressed in any way for too long labels Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested stale Has not been progressed in any way for too long
Projects
None yet
Development

No branches or pull requests

2 participants