Extension templates Handlebars.js

Is there a way to extend templates like in Django? My base template has a header that needs only a few pages. I would like to change this for other templates.

Something like

{% extends "base.html" %}
    ...
{% endblock %}

I am using Ember.js.

+4
source share
2 answers

As far as I know, this notation does not exist, also I did not see the concept of inheritance on the steering wheel templates layer.

However, I can imagine two ways to achieve what you want,

1. using the {{partial}}assistant http://emberjs.com/guides/templates/rendering-with-helpers/

{{partial}} , , .

2. http://emberjs.com/guides/views/adding-layouts-to-views/

, , /, , layoutName.

+1

, Django. , . npm, Handlebar-layouts, .

0

Source: https://habr.com/ru/post/1532268/


All Articles