GithubHelp home page GithubHelp logo

nested object rendering about riot HOT 14 CLOSED

tpaz avatar tpaz commented on May 17, 2024
nested object rendering

from riot.

Comments (14)

tipiirai avatar tipiirai commented on May 17, 2024

This is a decent request. Probably need to implement it. Thanks!

from riot.

tpaz avatar tpaz commented on May 17, 2024

of-course it might somewhat risk the renderer current performance though ;)

from riot.

tipiirai avatar tipiirai commented on May 17, 2024

Yeah. However this doesn't sound too heavy and is useful. I've had the same need as well.

from riot.

tpaz avatar tpaz commented on May 17, 2024

great. looking forward then... (I'm afraid to touch that black magic regex function myself :))

from riot.

tipiirai avatar tipiirai commented on May 17, 2024

Seems @potomak did the job already! Support for nested objects is now there. Enjoy!

from riot.

tpaz avatar tpaz commented on May 17, 2024

Hi. Tried to use the fix but doesn't seem to work?! :( I get literally the "{obj.property}" string rather than the value.

from riot.

tipiirai avatar tipiirai commented on May 17, 2024

@potomak can you check the above? Thank you!

from riot.

potomak avatar potomak commented on May 17, 2024

@tipiirai @tpaz I don't see any error, see http://jsbin.com/dezazate/1/edit
I also added a test case for the feature that is passing without errors, see https://github.com/fork-n-roll/riotjs/blob/c3f60ddd09bd46a4374ef49df0163bbb23215d25/test/render_test.js#L67-L69

from riot.

tpaz avatar tpaz commented on May 17, 2024

@potomak yes I saw the assertion test. yet in my environment it failed. Sample works indeed. It was a problem in my environment. works charms now :)

from riot.

fernandoacorreia avatar fernandoacorreia commented on May 17, 2024

This is very useful. In my usage I also found this limitation to be too big a nuisance. Thanks for fixing.

from riot.

tipiirai avatar tipiirai commented on May 17, 2024

Yeah. Seems to perform well and doesn't add any logic on the template layer.

from riot.

mgustafsson1 avatar mgustafsson1 commented on May 17, 2024

Hi @potomak - is it possible to use key['property'], e.g. person['firstName'] as per your example, too? I'm guessing not, just posting here to make sure I'm not using it wrong :)

from riot.

potomak avatar potomak commented on May 17, 2024

@mgustafsson1 no you can't, you can use only . to reference object properties right now.

from riot.

mgustafsson1 avatar mgustafsson1 commented on May 17, 2024

@potomak That was quick, thank you! Will use dot notation only for now.

from riot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.