https://github.com/angular/angular
Raw File
Tip revision: c25927da256163e3cb02d79769da5dd870869353 authored by Andrew Kushnir on 17 November 2021, 17:35:20 UTC
release: cut the v13.0.2 release (#44199)
Tip revision: c25927d
elements.ts
import {ChangeDetectionStrategy, Component, Input, ViewEncapsulation} from '@angular/core';

@Component({
  selector: 'hello-world-el',
  template: 'Hello {{name}}!',
})
export class HelloWorldComponent {
  @Input() name: string = 'World';
}

@Component({
  selector: 'hello-world-onpush-el',
  template: 'Hello {{name}}!',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HelloWorldOnpushComponent {
  @Input() name: string = 'World';
}

@Component({
  selector: 'hello-world-shadow-el',
  template: 'Hello {{name}}!',
  encapsulation: ViewEncapsulation.ShadowDom,
})
export class HelloWorldShadowComponent {
  @Input() name: string = 'World';
}

@Component({
  selector: 'test-card',
  template: `
    <header>
      <slot name="card-header"></slot>
    </header>
    <slot></slot>
    <footer>
      <slot name="card-footer"></slot>
    </footer>`,
  encapsulation: ViewEncapsulation.ShadowDom,
})
export class TestCardComponent {
}
back to top