Skip to content

Commit

Permalink
feat: on push strategy for code snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardmarcinco committed Dec 15, 2024
1 parent 0392363 commit f538feb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/code-snippet/code-snippet.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
HostBinding,
ViewChild,
AfterViewInit,
OnInit
OnInit,
ChangeDetectionStrategy
} from "@angular/core";

import { I18n } from "carbon-components-angular/i18n";
Expand Down Expand Up @@ -66,9 +67,7 @@ export enum SnippetType {
}
}
@if (!skeleton) {
<pre #codeContent (scroll)="(display === 'multi' ? handleScroll() : null)">
<code #code><ng-container *ngTemplateOutlet="codeTemplate" /></code>
</pre>
<pre #codeContent (scroll)="(display === 'multi' ? handleScroll() : null)"><code #code><ng-container *ngTemplateOutlet="codeTemplate" /></code></pre>
}
</div>
@if (hasLeft) {
Expand Down Expand Up @@ -135,7 +134,8 @@ export enum SnippetType {
<ng-template #codeTemplate>
<ng-content />
</ng-template>
`
`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class CodeSnippet extends BaseIconButton implements OnInit, AfterViewInit {
@HostBinding("class.cds--snippet") get snippetClass() {
Expand Down

0 comments on commit f538feb

Please sign in to comment.