Skip to content

Commit

Permalink
[ngssm-schematics] Fix generated component by forcing standalone gene…
Browse files Browse the repository at this point in the history
…ration (#249) (#250)
  • Loading branch information
LionMarc authored Jan 18, 2025
1 parent 060564a commit 307f33f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { CommonModule } from '@angular/common';<% } %>
import { NgSsmComponent, Store } from 'ngssm-store';

@Component({<% if(!skipSelector) {%>
selector: '<%= selector %>',<%}%><% if(standalone) {%>
standalone: true,
imports: [CommonModule],<%}%><% if(inlineTemplate) { %>
selector: '<%= selector %>',<%}%>
imports: [CommonModule],<% if(inlineTemplate) { %>
template: `
<p>
<%= dasherize(name) %> works!
Expand Down
1 change: 1 addition & 0 deletions projects/ngssm-schematics/schematics/component/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export function component(options: AngularComponentOptionsSchema): Rule {
// component selector
angularComponentOptions.selector =
angularComponentOptions.selector || buildSelector(angularComponentOptions, (project && project.prefix) || '');
angularComponentOptions.standalone = true;

const componentPath =
`/${angularComponentOptions.path}/` + (angularComponentOptions.flat ? '' : strings.dasherize(angularComponentOptions.name) + '/');
Expand Down

0 comments on commit 307f33f

Please sign in to comment.