forked from angular/angular.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathngNonBindable.js
37 lines (36 loc) · 1.37 KB
/
ngNonBindable.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'use strict';
/**
* @ngdoc directive
* @name ngNonBindable
* @restrict AC
* @priority 1000
* @element ANY
*
* @description
* The `ngNonBindable` directive tells AngularJS not to compile or bind the contents of the current
* DOM element.AngularJS will generally ignore each attribute of the element itself. Attributes will
* *not* be ignored if they are part of a directive that has a higher priority than that of the
* `ngNonBindable` directive.
*
* This is useful if the element contains what appears to be AngularJS directives and bindings but
* which should be ignored by AngularJS. This could be the case if you have a site that displays
* snippets of code, for instance.
*
* @example
* In this example there are two locations where a simple interpolation binding (`{{}}`) is present,
* but the one wrapped in `ngNonBindable` is left alone.
*
<example name="ng-non-bindable">
<file name="index.html">
<div>Normal: {{1 + 2}}</div>
<div ng-non-bindable>Ignored: {{1 + 2}}</div>
</file>
<file name="protractor.js" type="protractor">
it('should check ng-non-bindable', function() {
expect(element(by.binding('1 + 2')).getText()).toContain('3');
expect(element.all(by.css('div')).last().getText()).toMatch(/1 \+ 2/);
});
</file>
</example>
*/
var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });