如何在角度中使用“最小”优先级?

时间:2015-06-22 17:18:41

标签: angularjs angularjs-directive

我有一个属性指令。我不确定它需要设置的优先级;我所知道的是它需要成为最后一个链接指令。我应该为它指定什么优先级?

例如,假设我在一个元素attributeA和attributeB上有两个属性指令。我不知道attributeA的priority,但我想在attributeA之后链接attributeB。

以下是为什么需要这个“最少”(数字最高)优先级的真实场景:attributeAattributeB是创建的自定义指令。 attributeB必须在attributeA(或任何其他自定义指令)之后运行。 attributeA最初设置的优先级低于attributeB。然后有人将attributeA的优先级更改为数字高于attributeB的数字,因为此开发人员不了解attributeBattributeB必须最后关联。因此,attributeB因为其优先级现在在数值上低于attributeA而中断。

如果有办法说“无论这个元素的其他指令是什么,总是最后链接attributeB,这不会发生。

1 个答案:

答案 0 :(得分:2)

指令的默认优先级为0. <VirtualHost *:7080> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf </VirtualHost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 有1000和ngRepeat 500.最低prio为ngModel或任何其他负数。