rangle / angular-2-aot-sandbox

Sandbox for testing Angular 2's AoT specifically what expressions break it
297 stars 22 forks source link

RegExp and its literal version is not supported too #18

Open e-cloud opened 7 years ago

e-cloud commented 7 years ago
export const API_REGEXP = new RegExp('^' + apiPrefix)

export const Default_Interceptor_config: HttpInterceptorConfig = {
    interceptors: [
        {
            interceptor: RequestHeadersInterceptor,
            patterns: [API_REGEXP],   // --> empty array after aot
        },
        {
            interceptor: RequestRestifyInterceptor,
            patterns: [API_REGEXP],   // --> empty array after aot
        },
        {
            interceptor: ResponseErrorForwardInterceptor,
            patterns: [API_REGEXP],   // --> empty array after aot
        },
    ]
}
jogelin commented 6 years ago

I think I have the same kind of errors:

export const FORMLY_CONFIG: ConfigOption = {
  types: [
    {
      name: 'nrn-field',
      extends: 'input-mask-field',
      defaultOptions: {
        templateOptions: {
          maskConfig: {
            mask: [/\d/],                  // --> Error on this line, work in JIT
            showMask: false,
            guide: true,
            placeholderChar: '_'
          },
          required: true
        }
      }
    }
  ]
};

Error:

ERROR in ..\..\..\libs\person\src\formly\formly-person.module.ts(9,56): Error during template compile of 'PersonFormlyModule'
  Expression form not supported in 'FORMLY_CONFIG'
    'FORMLY_CONFIG' contains the error at ..\..\..\libs\person\src\formly\formly-person.config.ts(16,20).