1 | var __extends = (this && this.__extends) || (function () {
|
2 | var extendStatics = Object.setPrototypeOf ||
|
3 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
4 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
5 | return function (d, b) {
|
6 | extendStatics(d, b);
|
7 | function __() { this.constructor = d; }
|
8 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
9 | };
|
10 | })();
|
11 | import { resolveForwardRef } from '@angular/core';
|
12 | import { ProviderMeta } from '@angular/compiler';
|
13 | import { Symbol } from './symbol';
|
14 | import { ProviderSymbol } from './provider-symbol';
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | var PipeSymbol = (function (_super) {
|
23 | __extends(PipeSymbol, _super);
|
24 | |
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | function PipeSymbol(program, symbol, resolver, metadataResolver, projectSymbols) {
|
35 | var _this = _super.call(this, program, symbol) || this;
|
36 | _this.resolver = resolver;
|
37 | _this.metadataResolver = metadataResolver;
|
38 | _this.projectSymbols = projectSymbols;
|
39 | return _this;
|
40 | }
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | PipeSymbol.prototype.getModule = function () {
|
49 | return this.projectSymbols.getAnalyzedModules().ngModuleByPipeOrDirective.get(this.symbol);
|
50 | };
|
51 | |
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | PipeSymbol.prototype.getMetadata = function () {
|
59 | return this.resolver.resolve(resolveForwardRef(this.symbol));
|
60 | };
|
61 | PipeSymbol.prototype.getDependencies = function () {
|
62 | var _this = this;
|
63 | var summary = this.metadataResolver.getInjectableSummary(this.symbol);
|
64 | if (!summary) {
|
65 | return [];
|
66 | }
|
67 | else {
|
68 | return (summary.type.diDeps || []).map(function (d) {
|
69 | var token = d.token;
|
70 | if (d.token) {
|
71 | if (d.token.identifier) {
|
72 | token = d.token.identifier.reference;
|
73 | }
|
74 | }
|
75 | var meta = new ProviderMeta(token, { useClass: d.value });
|
76 | return new ProviderSymbol(_this._program, _this.metadataResolver.getProviderMetadata(meta), _this.metadataResolver);
|
77 | });
|
78 | }
|
79 | };
|
80 | return PipeSymbol;
|
81 | }(Symbol));
|
82 | export { PipeSymbol };
|
83 |
|
\ | No newline at end of file |