tag-manager icon indicating copy to clipboard operation
tag-manager copied to clipboard

Variables in Custom JS Funtion Variable

Open ulcuber opened this issue 1 year ago • 3 comments

Description:

Resolves #212

Review

ulcuber avatar Aug 01 '22 13:08 ulcuber

@ulcuber Does this code works for you ?

function () { if ({{ClickElement}}) { return {{ClickElement}}.getAttribute('class'); } else { return "111"; } };

AltamashShaikh avatar Aug 02 '22 06:08 AltamashShaikh

@AltamashShaikh checked this issue. It was just creating variable. I forgot to evaluate variable. Now it works

ulcuber avatar Aug 04 '22 08:08 ulcuber

@AltamashShaikh @ulcuber the reason I didn't implement it I believe was because I couldn't figure out how to make this work without using eval. I believe in some cases this wouldn't work maybe like below?

var {{ foo }} = {{ bar }};

Not sure if such cases would work? Or if the variables would only work in few specific places?

tsteur avatar Aug 07 '22 20:08 tsteur