From 57fa804bb2c8a44b83774ccdc00e4dd55e71346e Mon Sep 17 00:00:00 2001 From: alefra Date: Sat, 30 Apr 2022 14:22:16 +0200 Subject: [PATCH] docs: remove Component and Directives (#45828) Move all content to example-zippy.component.ts PR Close #45828 --- .../src/app/app.component.ts | 37 +------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/aio/content/examples/content-projection/src/app/app.component.ts b/aio/content/examples/content-projection/src/app/app.component.ts index 926beb11235..f45969e5cde 100644 --- a/aio/content/examples/content-projection/src/app/app.component.ts +++ b/aio/content/examples/content-projection/src/app/app.component.ts @@ -1,42 +1,7 @@ -import { Component, Directive, Input, TemplateRef, ContentChild, HostBinding, HostListener } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent {} - -@Directive({ - selector: 'button[appExampleZippyToggle]', -}) -export class ZippyToggleDirective { - @HostBinding('attr.aria-expanded') ariaExpanded = this.zippy.expanded; - @HostBinding('attr.aria-controls') ariaControls = this.zippy.contentId; - @HostListener('click') toggleZippy() { - this.zippy.expanded = !this.zippy.expanded; - } - constructor(public zippy: ZippyComponent) {} -} - -// #docregion zippycontentdirective -@Directive({ - selector: '[appExampleZippyContent]' -}) -export class ZippyContentDirective { - constructor(public templateRef: TemplateRef) {} -} -// #enddocregion zippycontentdirective - -let nextId = 0; - -@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 -}