0

So if I have something like this:

<section ng-non-bindable>
    <!-- Lots of elements -->
    <p my-amazing-directive></p>
</section>

How can I make sure that my-amazing-directive gets compiled?

4
  • I've already tried creating a custom directive with a priority of 1001, but not even that directive gets compiled inside an ng-non-bindble. Commented Dec 16, 2019 at 19:52
  • Check the Doc: docs.angularjs.org/api/ng/directive/ngNonBindable ``` 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.``` it says you shouldn't compile things inside ng-non-bindable Commented Dec 16, 2019 at 19:54
  • @RichardFazzi - Thanks for your comment. I did read the docs prior to asking this question, that's how I came up with the idea of maybe making this work with a higher priority directive. I'm asking if there's a way to accomplish this. Thanks. Commented Dec 16, 2019 at 19:56
  • sorry for miss guide you, please, could you explain what do you want this for? what are you trying to accomplish? Commented Dec 16, 2019 at 19:58

1 Answer 1

1

There is not a simple way to accomplish what you want.

Under the hood, the ng-non-bindable directive uses:

`terminal: true`

From the Docs:

terminal

If set to true then the current priority will be the last set of directives which will execute (any directives at the current priority will still execute as the order of execution on same priority is undefined). Note that expressions and other directives used in the directive's template will also be excluded from execution.

AngularJS Comprehensive Directive API Reference - terminal

For more information, see

Sign up to request clarification or add additional context in comments.

2 Comments

Yeah, I also found that in the docs. Well, thanks! Guess I'll have to think about something else.
I am curious as to your use case. Why do you want to do this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.