angular.module.ng.$compileProvider.directive.ng-non-bindable

Description

Sometimes it is necessary to write code which looks like bindings but which should be left alone by angular. Use ng-non-bindable to make angular ignore a chunk of HTML.

Usage

as attribute
<ANY ng-non-bindable>
   ...
</ANY>
as class
<ANY class="ng-non-bindable">
   ...
</ANY>

Directive info

  • This directive executes at priority level 1000.

Example

  <div>Normal: {{1 + 2}}</div>
  <div ng-non-bindable>Ignored: {{1 + 2}}</div>
 it('should check ng-non-bindable', function() {
   expect(using('.doc-example-live').binding('1 + 2')).toBe('3');
   expect(using('.doc-example-live').element('div:last').text()).
     toMatch(/1 \+ 2/);
 });