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

@ -4,7 +4,7 @@ import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {IS_DART} from '../../src/facade/lang';
import {Component, Pipe, PipeTransform, provide, ViewMetadata, PLATFORM_PIPES, OpaqueToken, Injector} from '@angular/core';
import {Component, Pipe, PipeTransform, provide, ViewMetadata, OpaqueToken, Injector} from '@angular/core';
import {NgIf, NgClass} from '@angular/common';
import {CompilerConfig} from '@angular/compiler';
@ -31,7 +31,11 @@ function declareTests(isJit: boolean) {
describe('regressions', () => {
describe('platform pipes', () => {
beforeEachProviders(() => [{provide: PLATFORM_PIPES, useValue: [PlatformPipe], multi: true}]);
beforeEachProviders(
() => [{
provide: CompilerConfig,
useValue: new CompilerConfig(true, false, isJit, null, null, [PlatformPipe])
}]);
it('should overwrite them by custom pipes',
inject(