angular.widget.@ng:non-bindable

Work In Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

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.

NOTE: ng:non-bindable looks like a directive, but is actually an attribute widget.

Usage

In HTML Template Binding

<ANY @ng:non-bindable">
  ...
</ANY>
  

Parameters

Example

In this example there are two location where a siple binding ({{}}) is present, but the one wrapped in ng:non-bindable is left alone.

<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/); });