本文整理汇总了TypeScript中angular2/change_detection.Pipes.append方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Pipes.append方法的具体用法?TypeScript Pipes.append怎么用?TypeScript Pipes.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/change_detection.Pipes
的用法示例。
在下文中一共展示了Pipes.append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: bind
import {bind} from 'angular2/di';
import {PipeRegistry, Pipes, defaultPipes} from 'angular2/change_detection';
/*
* App Pipes
*/
import {capitalize} from './CapitalizePipe';
import {rxAsync} from './RxPipe';
var newPipesBindings;
// Alpha.31
if (Pipes) {
newPipesBindings = bind(Pipes).toValue(Pipes.append({
'async': rxAsync,
'capitalize': capitalize
// add more pipes to this Map
}));
}
// Alpha.30
else if (PipeRegistry) {
// include the default pipes and our own
let replaceBindings = Object.assign({}, defaultPipes, {
'async': rxAsync,
'capitalize': capitalize
// add more pipes to this Map
});
newPipesBindings = bind(PipeRegistry).toValue(new PipeRegistry(replaceBindings));
}
export var appPipeInjectables = [
示例2:
/// <reference path="../../typings/custom.d.ts" />
import {bind} from 'angular2/di';
import {PipeRegistry, Pipes, defaultPipes} from 'angular2/change_detection';
import {capitalize} from './CapitalizePipe';
import {rxAsync} from './RxPipe';
export var appPipes = [
Pipes.append({
'async': rxAsync,
'capitalize': capitalize
// add more pipes to this Map
})
];
//export var appPipesRegistry = [
// bind(PipeRegistry).toValue(new PipeRegistry(appPipes))
//];