Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 99625b1

Browse files
committed
feat(theatre): change sheet to a Directive
1 parent ebcb6f7 commit 99625b1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

libs/theatre/src/lib/sequence.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const defaultOptions: TheatreSequenceOptions = {
3434
delay: 0,
3535
};
3636

37-
@Directive({ selector: 'theatre-sheet[sequence]', exportAs: 'sequence' })
37+
@Directive({ selector: '[sheet][sequence]', exportAs: 'sequence' })
3838
export class TheatreSequence {
3939
options = input(defaultOptions, { alias: 'sequence', transform: mergeInputs(defaultOptions) });
4040
audioOptions = input<AttachAudioOptions | undefined>(undefined, { alias: 'sequenceAudio' });

libs/theatre/src/lib/sheet.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { ChangeDetectionStrategy, Component, computed, DestroyRef, inject, input } from '@angular/core';
1+
import { computed, DestroyRef, Directive, inject, input } from '@angular/core';
22
import { TheatreProject } from './project';
33

4-
@Component({
5-
selector: 'theatre-sheet',
6-
template: `
7-
<ng-content />
8-
`,
9-
changeDetection: ChangeDetectionStrategy.OnPush,
10-
})
4+
@Directive({ selector: '[sheet]', exportAs: 'sheet' })
115
export class TheatreSheet {
12-
name = input('default-theatre-sheet');
6+
name = input('default-theatre-sheet', {
7+
transform: (value: string) => {
8+
if (value === '') return 'default-theatre-sheet';
9+
return value;
10+
},
11+
alias: 'sheet',
12+
});
1313

1414
private project = inject(TheatreProject);
1515

0 commit comments

Comments
 (0)