AngularJS: Directive with arbitrary start and end symbols

72 views Asked by At

What?

I'd like to use an Angular .directive by using arbitrary start and end symbols, e.g. square brackets:

<myDirective>callDirectiveAsUsual</myDirective><!-- usual directive call -->

<div>[[callDirectiveWithArbitrarySymbols]]</div><!-- new directive call -->

Why?

To make using a translation library much easier. Instead of annotating HTML, I would like to write [[TranslateMePlease!]].

Questions

  1. Is it possible to define custom start and end symbols for a .directive? (According to the docs, this is not possible.)
  2. Do I have to add a custom $interpolateProvider to the interpolation pipeline? (Assuming there is such an an interpolation pipeline in Angular.)
  3. Do I have to write my own version of ng-bind? ng-bind-custom which uses its own $interpolateProviderCustom, which looks out for square brackets?
0

There are 0 answers