Skip to content

Commit

Permalink
refactor(ComponentAuthoringComponent): Convert to standalone (#1953)
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokiterashima authored Sep 21, 2024
1 parent 022da86 commit 287d96d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/teacher/component-authoring.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ import { RequiredErrorLabelComponent } from '../../assets/wise5/authoringTool/no
AnimationAuthoring,
AudioOscillatorAuthoring,
AuthorUrlParametersComponent,
ComponentAuthoringComponent,
ConceptMapAuthoring,
CreateNewPeerGroupingDialogComponent,
DrawAuthoring,
Expand Down Expand Up @@ -174,6 +173,7 @@ import { RequiredErrorLabelComponent } from '../../assets/wise5/authoringTool/no
WiseLinkAuthoringDialogComponent
],
imports: [
ComponentAuthoringComponent,
ComponentConstraintAuthoringComponent,
EditComponentAdvancedButtonComponent,
EditComponentWidthComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { ComponentContent } from '../../common/ComponentContent';
import { components } from '../../components/Components';

@Component({
selector: 'component-authoring-component',
selector: 'component-authoring',
standalone: true,
template: '<div #component></div>'
})
export class ComponentAuthoringComponent {
Expand All @@ -21,7 +22,10 @@ export class ComponentAuthoringComponent {
private componentRef: ComponentRef<any>;
@Input() private nodeId: string;

constructor(private applicationRef: ApplicationRef, private injector: EnvironmentInjector) {}
constructor(
private applicationRef: ApplicationRef,
private injector: EnvironmentInjector
) {}

ngAfterViewInit(): void {
this.componentRef = createComponent(components[this.componentContent.type].authoring, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@ <h5 i18n>Components</h5>
</mat-expansion-panel-header>
<div>
@if (componentsToExpanded[component.id]) {
<component-authoring-component
[nodeId]="nodeId"
[componentContent]="component"
></component-authoring-component>
<component-authoring [nodeId]="nodeId" [componentContent]="component" />
}
</div>
</mat-expansion-panel>
Expand Down

0 comments on commit 287d96d

Please sign in to comment.