Skip to content

Instantly share code, notes, and snippets.

@calacitizen
Last active April 28, 2016 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calacitizen/fc7c6ddd3fcdc831aa6e7c154cdf2c26 to your computer and use it in GitHub Desktop.
Save calacitizen/fc7c6ddd3fcdc831aa6e7c154cdf2c26 to your computer and use it in GitHub Desktop.
Контекстно-зависимые шаблоны

###Контекстно-зависимые шаблоны

Через тег компонент можно передавать как значения так и другие шаблоны.

  <div class="some-class" data-property="{{ outerproperty }}"> 
    <component data-component="SBIS3.CONTROLS.SomeControl">
      <ws:someproperty>
        <h1 class="{{ innerproperty }}"> // В данном случае значение будет из внутреннего контекста
          <div>{{ outerproperty }}</div> // В данном случае значение будет из внешнего контекста
        </h1>
      </ws:someproperty>
    </div>
  </div>

Шаблон компонента SBIS3.CONTROLS.SomeControl

  <div>
    <ws:partial template="{{ someproperty }}" innerproperty="{{ 321 }}"> /// Результат <h1 class="321"><div>123</div></h1>
  </div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment