本文整理匯總了TypeScript中@angular/compiler.compilePipeFromMetadata函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript compilePipeFromMetadata函數的具體用法?TypeScript compilePipeFromMetadata怎麽用?TypeScript compilePipeFromMetadata使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了compilePipeFromMetadata函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: compile
compile(node: ts.ClassDeclaration, analysis: R3PipeMetadata): CompileResult {
const res = compilePipeFromMetadata(analysis);
return {
name: 'ngPipeDef',
initializer: res.expression,
statements: [],
type: res.type,
};
}
示例2: compile
compile(node: ts.ClassDeclaration, analysis: PipeHandlerData): CompileResult {
const res = compilePipeFromMetadata(analysis.meta);
const statements = res.statements;
if (analysis.metadataStmt !== null) {
statements.push(analysis.metadataStmt);
}
return {
name: 'ngPipeDef',
initializer: res.expression, statements,
type: res.type,
};
}
示例3: compilePipeFromMetadata
get: () => {
if (ngPipeDef === null) {
const sourceMapUrl = `ng://${stringify(type)}/ngPipeDef.js`;
const name = type.name;
const res = compilePipeFromMetadata({
name,
type: new WrappedNodeExpr(type),
deps: reflectDependencies(type),
pipeName: meta.name,
pure: meta.pure !== undefined ? meta.pure : true,
});
ngPipeDef = jitExpression(res.expression, angularCoreEnv, sourceMapUrl, res.statements);
}
return ngPipeDef;
},