Skip to content

Commit

Permalink
fix(@schematics/angular): explicitly set standalone:false
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrems committed Oct 16, 2024
1 parent 13b65df commit fcf7443
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { Component } from '@angular/core';
%><router-outlet /><%
} %>
`,<% } else { %>
templateUrl: './app.component.html',<% } if(inlineStyle) { %>
templateUrl: './app.component.html',<% } %>
standalone: false,<% if(inlineStyle) { %>
styles: []<% } else { %>
styleUrl: './app.component.<%= style %>'<% } %>
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { <% if(changeDetection !== 'Default') { %>ChangeDetectionStrategy, <% }%
@Component({<% if(!skipSelector) {%>
selector: '<%= selector %>',<%}%><% if(standalone) {%>
standalone: true,
imports: [],<%}%><% if(inlineTemplate) { %>
imports: [],<%} else { %>
standalone: false,
<% }%><% if(inlineTemplate) { %>
template: `
<p>
<%= dasherize(name) %> works!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Directive } from '@angular/core';

@Directive({
selector: '[<%= selector %>]'<% if(standalone) {%>,
standalone: true<%}%>
standalone: true<%} else {%>,
standalone: false<%}%>
})
export class <%= classify(name) %>Directive {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
name: '<%= camelize(name) %>'<% if(standalone) {%>,
standalone: true<%}%>
standalone: true<%} else {%>,
standalone: false<%}%>
})
export class <%= classify(name) %>Pipe implements PipeTransform {

Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/test/test-scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default async function () {
'src/app/app.component.ts': `
import { Component } from '@angular/core';
@Component({ selector: 'app-root', template: '' })
@Component({ selector: 'app-root', template: '', standalone: false })
export class AppComponent {
stringScriptGlobalProp = stringScriptGlobal;
inputScriptGlobalProp = inputScriptGlobal;
Expand Down

0 comments on commit fcf7443

Please sign in to comment.