refactor(compiler): make PLATFORM_PIPES / PLATFORM_DIRECTIVES an option on CompilerConfig

This aligns the configuration of platform pipes / directives with offline compilation.

BREAKING CHANGE:
- `PLATFORM_PIPES` and `PLATFORM_DIRECTIVES` now are fields on `CompilerConfig`. 
  Instead of providing a binding to these tokens, provide a binding for `CompilerConfig` instead.
This commit is contained in:
Tobias Bosch
2016-06-13 08:35:31 -07:00
parent 1fb0db4aeb
commit 1745366530
9 changed files with 43 additions and 81 deletions

View File

@ -1,7 +1,7 @@
import {ViewEncapsulation} from '@angular/core';
import {unimplemented} from '../src/facade/exceptions';
import {isBlank} from '../src/facade/lang';
import {Type, isBlank} from '../src/facade/lang';
import {CompileIdentifierMetadata} from './compile_metadata';
import {Identifiers} from './identifiers';
@ -12,7 +12,8 @@ export class CompilerConfig {
constructor(
public genDebugInfo: boolean, public logBindingUpdate: boolean, public useJit: boolean,
renderTypes: RenderTypes = null, defaultEncapsulation: ViewEncapsulation = null) {
renderTypes: RenderTypes = null, defaultEncapsulation: ViewEncapsulation = null,
public platformDirectives: any[] = [], public platformPipes: any[] = []) {
if (isBlank(renderTypes)) {
renderTypes = new DefaultRenderTypes();
}