为什么Angular Dart 2 ViewEncpasulation不再接受枚举?

时间:2015-09-12 19:42:13

标签: dart angular-dart angular

在Angular Dart 2 Alpha 35中,@ view组件接受了枚举值:

@View(
  styleUrls: const ["package:tickets/client/components/flight_display/flight_display.css"],
  templateUrl: "package:tickets/client/components/flight_display/flight_display.html",
  directives: const[CORE_DIRECTIVES],
  encapsulation: ViewEncapsulation.NONE
)

封装:ViewEncapsulation.NONE现在抛出以下错误:

Error:(11, 18) Arguments of a constant creation must be constant
 expressions

问题: 将值从枚举传递给ViewEncapsulation对象的提供方式是什么?

上下文

以下是Angular.Dart 2 Lib的Enum:

enum ViewEncapsulation {
  /**
   * Emulate scoping of styles by preprocessing the style rules
   * and adding additional attributes to elements. This is the default.
   */
  Emulated,
  /**
   * Uses the native mechanism of the renderer. For the DOM this means creating a ShadowRoot.
   */
  Native,
  /**
   * Don't scope the template nor the styles.
   */
  None
}

0 个答案:

没有答案