Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs(ngNonBindable): Document effect on attributes #16338

Merged
merged 3 commits into from
Nov 27, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/ng/directive/ngNonBindable.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
*
* @description
* The `ngNonBindable` directive tells AngularJS not to compile or bind the contents of the current
* DOM element. 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.
* DOM element.AngularJS will generally ignore each attribute of the element itself. Attributes will
Copy link
Contributor

@petebacondarwin petebacondarwin Nov 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the most succinct and accurate way of saying this is:

... tells AngularJS not to compile or bind the contents of the
current DOM element, including attribute directives that have a
lower priority than `ngNonBindable`. 

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe including attribute directives on the element (itself) to make it clear that we are not referring to attribute directives on the children.
(Also, I don't think this is restricted to attribute directives 😁)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the final text would be:

The ngNonBindable directive tells AngularJS not to compile or bind the contents of the
current DOM element, including directives on the element itself that have a
lower priority than ngNonBindable.
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.

@jugglinmike would you make this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing.

* *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,
Expand Down