2020-11-04 18:46:59 +00:00
|
|
|
import {ChangeDetectionStrategy, Component, Input, ViewEncapsulation} from '@angular/core';
|
2018-07-15 23:02:16 +00:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'hello-world-el',
|
2020-11-04 18:45:33 +00:00
|
|
|
template: 'Hello {{name}}!',
|
2024-10-11 12:50:44 +00:00
|
|
|
standalone: false,
|
2018-07-15 23:02:16 +00:00
|
|
|
})
|
|
|
|
|
export class HelloWorldComponent {
|
|
|
|
|
@Input() name: string = 'World';
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-04 18:46:59 +00:00
|
|
|
@Component({
|
|
|
|
|
selector: 'hello-world-onpush-el',
|
|
|
|
|
template: 'Hello {{name}}!',
|
|
|
|
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
2024-10-11 12:50:44 +00:00
|
|
|
standalone: false,
|
2020-11-04 18:46:59 +00:00
|
|
|
})
|
|
|
|
|
export class HelloWorldOnpushComponent {
|
|
|
|
|
@Input() name: string = 'World';
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-15 23:02:16 +00:00
|
|
|
@Component({
|
|
|
|
|
selector: 'hello-world-shadow-el',
|
2020-11-04 18:45:33 +00:00
|
|
|
template: 'Hello {{name}}!',
|
|
|
|
|
encapsulation: ViewEncapsulation.ShadowDom,
|
2024-10-11 12:50:44 +00:00
|
|
|
standalone: false,
|
2018-07-15 23:02:16 +00:00
|
|
|
})
|
|
|
|
|
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,
|
2024-10-11 12:50:44 +00:00
|
|
|
standalone: false,
|
2018-07-15 23:02:16 +00:00
|
|
|
})
|
|
|
|
|
export class TestCardComponent {}
|