Skip to content

Commit

Permalink
docs: create file to improve docs (#45828)
Browse files Browse the repository at this point in the history
Move ZippyComponent and ZippyContentDirective to example-zippy.component.ts file to improve readability of the docs

PR Close #45828
  • Loading branch information
alefra86 authored and jessicajaniuk committed Jun 10, 2022
1 parent d6c370b commit 008111d
Showing 1 changed file with 24 additions and 0 deletions.
@@ -0,0 +1,24 @@
import { Component, Directive, Input, TemplateRef, ContentChild} from '@angular/core';

let nextId = 0;

// #docregion zippycontentdirective
@Directive({
selector: '[appExampleZippyContent]'
})
export class ZippyContentDirective {
constructor(public templateRef: TemplateRef<unknown>) {}
}
// #enddocregion zippycontentdirective

@Component({
selector: 'app-example-zippy',
templateUrl: 'example-zippy.template.html',
})
export class ZippyComponent {
contentId = `zippy-${nextId++}`;
@Input() expanded = false;
// #docregion contentchild
@ContentChild(ZippyContentDirective) content!: ZippyContentDirective;
// #enddocregion contentchild
}

0 comments on commit 008111d

Please sign in to comment.