angular2 gulp任务正在编译但有错误

时间:2016-05-25 13:48:57

标签: typescript angular

我正在处理gulpfile,我想编译angular 2应用程序,但是我遇到了一些错误:

enter image description here

它们是什么意思,它不存在于类型“...”中,我如何使它存在? nativeWindow是null的地方如下:

public static void colorizeDatePicker(DatePicker datePicker) {
    Resources system = Resources.getSystem();
    int dayId = system.getIdentifier("day", "id", "android");
    int monthId = system.getIdentifier("month", "id", "android");
    int yearId = system.getIdentifier("year", "id", "android");

    NumberPicker dayPicker = (NumberPicker) datePicker.findViewById(dayId);
    NumberPicker monthPicker = (NumberPicker) datePicker.findViewById(monthId);
    NumberPicker yearPicker = (NumberPicker) datePicker.findViewById(yearId);

    setDividerColor(dayPicker);
    setDividerColor(monthPicker);
    setDividerColor(yearPicker);
}

private static void setDividerColor(NumberPicker picker) {
    if (picker == null)
        return;

    final int count = picker.getChildCount();
    for (int i = 0; i < count; i++) {
        try {
            Field dividerField = picker.getClass().getDeclaredField("mSelectionDivider");
            dividerField.setAccessible(true);
            ColorDrawable colorDrawable = new ColorDrawable(picker.getResources().getColor(R.color.colorAccent));
            dividerField.set(picker, colorDrawable);
            picker.invalidate();
        } catch (Exception e) {
            Log.w("setDividerColor", e);
        }
    }
}

1 个答案:

答案 0 :(得分:0)

您收到的错误消息显示,range上找不到属性preferences。这同样适用于您的WindowService。在getter中,您返回window对象,并在组件中尝试访问offerResults对象上的window。此属性对window对象没有任何意义,因为此对象代表浏览器中的一个打开窗口,我不会在该对象中存储任何数据。