How Do I Access an Object's Properties From a Template?

前端 未结 1 1707
囚心锁ツ
囚心锁ツ 2021-01-12 05:47

According to http://handlebarsjs.com/expressions.html, I should be able to do this:

{{article.title}}

But I can\'t see

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-12 06:34

    You should use {{#with object}}

    If your object is something like :

    my_object = {
        name : 'my_name',
        prop : 'my_prop'
    }
    

    In your template your can do :

    
    

    Here you go :)

    0 讨论(0)
提交回复
热议问题