nippur72 / RiotTS

RiotJS for TypeScript
MIT License
101 stars 8 forks source link

Classes properties in nested riot tags #39

Open alexhome82 opened 8 years ago

alexhome82 commented 8 years ago

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

screenshot_4

Thank you

nippur72 commented 8 years ago

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

alexhome82 commented 8 years ago

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