RiotTS icon indicating copy to clipboard operation
RiotTS copied to clipboard

Classes properties in nested riot tags

Open alexhome82 opened this issue 9 years ago • 2 comments

In nested tags have to use parent.parent ...., to access the class properties. How to solve this problem?

screenshot_4

Thank you

alexhome82 avatar Oct 20 '16 20:10 alexhome82

this is an unsolved Riot (not RiotTS) problem we friendly call it "parent.parent hell". It's because Riot changes the evaluation context when there is a nested tag. No other template engine works this way (angular, react-templates etc), the general approach is to maintain one evaluation context per tag definition.

I once proposed a solution but it was not merged. See also https://github.com/riot/riot/issues/972

nippur72 avatar Oct 21 '16 08:10 nippur72

screenshot_5 when i use javascript with riot-loader, it works well "riotjs-loader": "^3.0.0", "riot": "^2.6.1",

alexhome82 avatar Oct 21 '16 12:10 alexhome82