你能否在Angular 2中声明属性指令的顺序

时间:2017-02-22 15:39:27

标签: angular angular2-directives

我有following simple pluner我尝试使用属性指令在我的应用程序中添加(或覆盖)不同的选项。我看到的问题是这些指令的初始化顺序与DOM元素中指令的顺序不匹配。

所以即使我按顺序声明它们......

module.exports = function(context, req) { var xml = '<?xml version="1.0" encoding="UTF-8"?><Response><Say>Azure functions!</Say></Response>'; context.res = { "headers" : { "Content-Type" : 'text/xml' }, "body": xml, "isRaw" : true }; context.done(); };

他们似乎接受了申请声明中声明的顺序......

<div jgMoreOptions jgOptions [options]="options">

如果我有多个实现需要以不同的顺序加载指令,那么这是一个问题。

有没有办法在标签本身中声明指令的顺序?

Here is an example with both directives in a diff order

1 个答案:

答案 0 :(得分:1)

订单明确未定义

您需要以某种方式编写代码,以使订单无关紧要。