Skip to content

Commit

Permalink
chore: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
v.potekhin committed Dec 5, 2023
1 parent e2fac79 commit 44b4663
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 47 deletions.
28 changes: 0 additions & 28 deletions projects/ng-polymorpheus/src/classes/template.ts

This file was deleted.

14 changes: 2 additions & 12 deletions projects/ng-polymorpheus/src/directives/outlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {

import {PolymorpheusComponent} from '../classes/component';
import {PolymorpheusContext} from '../classes/context';
import {PolymorpheusTemplateContent} from '../classes/template';
import {PolymorpheusContent} from '../types/content';
import {PolymorpheusPrimitive} from '../types/primitive';
import {PolymorpheusTemplate} from './template';
Expand Down Expand Up @@ -76,12 +75,7 @@ export class PolymorpheusOutletDirective<C> implements OnChanges, DoCheck {
// tslint:disable-next-line:triple-equals
(context instanceof PolymorpheusContext && context.$implicit) !== null
) {
const injector =
this.content instanceof PolymorpheusTemplateContent
? this.content.createInjector(this.i)
: this.i;

this.vcr.createEmbeddedView(this.template, proxy, {injector});
this.vcr.createEmbeddedView(this.template, proxy, {injector: this.i});
}
}

Expand Down Expand Up @@ -125,9 +119,5 @@ function isComponent<C>(
function isTemplate<C>(
content: PolymorpheusContent<C>,
): content is PolymorpheusTemplate<C> | TemplateRef<C> {
return (
isDirective(content) ||
content instanceof TemplateRef ||
content instanceof PolymorpheusTemplateContent
);
return isDirective(content) || content instanceof TemplateRef;
}
1 change: 0 additions & 1 deletion projects/ng-polymorpheus/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Public API Surface of ng-polymorpheus
*/
export * from './classes/component';
export * from './classes/template';
export * from './directives/outlet';
export * from './directives/outlet';
export * from './directives/template';
Expand Down
6 changes: 2 additions & 4 deletions projects/ng-polymorpheus/src/tests/outlet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,10 @@ describe('PolymorpheusOutlet', () => {
element!: ElementRef<HTMLElement>;

@ViewChild('plain')
// eslint-disable-next-line @typescript-eslint/ban-types
template!: TemplateRef<{}>;
template!: TemplateRef<Record<never, never>>;

@ViewChild('polymorpheus')
// eslint-disable-next-line @typescript-eslint/ban-types
polymorpheus!: PolymorpheusTemplate<{}>;
polymorpheus!: PolymorpheusTemplate<Record<never, never>>;

polymorphic = false;

Expand Down
2 changes: 0 additions & 2 deletions projects/ng-polymorpheus/src/types/content.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {TemplateRef} from '@angular/core';

import {PolymorpheusComponent} from '../classes/component';
import {PolymorpheusTemplateContent} from '../classes/template';
import {PolymorpheusTemplate} from '../directives/template';
import {PolymorpheusHandler} from './handler';
import {PolymorpheusPrimitive} from './primitive';
Expand All @@ -14,5 +13,4 @@ export type PolymorpheusContent<C = any> =
| PolymorpheusHandler<C>
| PolymorpheusPrimitive
| PolymorpheusTemplate<Partial<C> | ''> // string is untyped, e.g. 'any'
| PolymorpheusTemplateContent<C>
| TemplateRef<Partial<C>>;

0 comments on commit 44b4663

Please sign in to comment.