Skip to content

Commit

Permalink
Merge pull request #11 from opf/fix/angular-standalone-components
Browse files Browse the repository at this point in the history
fix: import CommonModule in Angular standalone components
  • Loading branch information
b12f committed Jul 19, 2023
2 parents 9af6344 + ebbb630 commit 4ad8100
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-boats-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openproject/octicons': patch
---

fix: import CommonModule in Angular standalone components
2 changes: 2 additions & 0 deletions lib/octicons_angular/script/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const icons = Object.entries(octicons)
@Component({
selector: 'svg[op-octicon-${key}]',
standalone: true,
imports: [CommonModule],
template: \`
<title *ngIf="title">{{title}}</title>
Expand Down Expand Up @@ -74,6 +75,7 @@ async function writeIconExport(file) {
const count = icons.length
const code = `${GENERATED_HEADER}
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { OpOcticonComponentBase } from '../octicon-component-base';
${icons.map(({code}) => code).join('\n')}
Expand Down

0 comments on commit 4ad8100

Please sign in to comment.