If we need to control the order of compilation of our custom directives inside a single DOM node, we can assign them a priority. We can do this with the priority property in the directive's definition object that accepts a number where a higher value means that AngularJS will compile the directive before those with a lower value. The default value for the priority property is zero. If more than one directive in a DOM node have the same priority, their order of compilation is not defined. If a directive needs to stop the compilation of those with a lower priority, it can do that by assigning the value true to the terminal property in its definition object. By default terminal is false. The compilation of all the directives with the same priority as the terminal one will still be executed, only the compilation of the lower priority directives will be avoided.
You can check the described behavior in the example, where we've defined some directives with different priorities and some terminal directives as well.