feat(pipe): added the Pipe decorator and the pipe property to View

BREAKING CHANGE:
    Instead of configuring pipes via a Pipes object, now you can configure them by providing the pipes property to the View decorator.

    @Pipe({
      name: 'double'
    })
    class DoublePipe {
      transform(value, args) { return value * 2; }
    }

    @View({
      template: '{{ 10 | double}}'
      pipes: [DoublePipe]
    })
    class CustomComponent {}

Closes #3572
This commit is contained in:
vsavkin
2015-08-07 11:41:38 -07:00
committed by Victor Savkin
parent 02b7e61ef7
commit 5b5d31fa9a
62 changed files with 627 additions and 524 deletions

View File

@ -4,10 +4,11 @@
* This module provides advanced support for extending change detection.
*/
export {UpperCasePipe} from './src/change_detection/pipes/uppercase_pipe';
export {LowerCasePipe} from './src/change_detection/pipes/lowercase_pipe';
export {AsyncPipe} from './src/change_detection/pipes/async_pipe';
export {JsonPipe} from './src/change_detection/pipes/json_pipe';
export {DatePipe} from './src/change_detection/pipes/date_pipe';
export {DecimalPipe, PercentPipe, CurrencyPipe} from './src/change_detection/pipes/number_pipe';
export {LimitToPipe} from './src/change_detection/pipes/limit_to_pipe';
export {UpperCasePipe} from './src/pipes/uppercase_pipe';
export {LowerCasePipe} from './src/pipes/lowercase_pipe';
export {AsyncPipe} from './src/pipes/async_pipe';
export {JsonPipe} from './src/pipes/json_pipe';
export {DatePipe} from './src/pipes/date_pipe';
export {DecimalPipe, PercentPipe, CurrencyPipe} from './src/pipes/number_pipe';
export {LimitToPipe} from './src/pipes/limit_to_pipe';
export {DEFAULT_PIPES_TOKEN, DEFAULT_PIPES} from './src/pipes/default_pipes';