Skip to main content

ac-context

Create Accent contexts on an HTML element using markup.

Usage#

Basic Usage#

<element ac-context="{ your data... }"></element>

Let's make an Accent context with the data { foo: 'bar' }

<body ac-context="{ foo: 'bar' }">  <!-- ... --></body>

Helper Directives#

DirectiveDescription
@idThe ID of the context
@extendsThe parent context for the newly created context (context inheritance)

Below is an example of context inheritance with an assigned context ID. This can be done with the helper directives above.

<body ac-context="{ foo: 'bar' }" @id="bodyContext">  <div ac-context="{ bar: 'baz' }" @extends="bodyContext" @id="secondContext">    <!-- ... -->  </div></body>

In the example above, secondContext inherits all properties of bodyContext, meaning that the context scope of secondContext is now { foo: 'bar', bar: 'baz' }.