Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ describe('App', () => {
declarations: [
App
],
}).compileComponents();
})
.compileComponents();
});

it('should create the app', () => {
Expand All @@ -20,7 +21,7 @@ describe('App', () => {
expect(app).toBeTruthy();
});

it('should render title', <% if(zoneless) { %>async <% } %>() => {
it('should render title', <% if (zoneless) { %>async <% } %>() => {
const fixture = TestBed.createComponent(App);
<%= zoneless ? 'await fixture.whenStable();' : 'fixture.detectChanges();' %>
const compiled = fixture.nativeElement as HTMLElement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Component, signal } from '@angular/core';

@Component({
selector: '<%= selector %>',<% if(inlineTemplate) { %>
selector: '<%= selector %>',
standalone: false,<% if (inlineStyle) { %>
styles: [],<% } else { %>
styleUrl: './app<%= suffix %>.<%= style %>',<% } %><% if (inlineTemplate) { %>
template: `
<h1>Hello, {{ title() }}</h1>
<p>Congratulations! Your app is running. 🎉</p>
Expand All @@ -11,9 +14,6 @@ import { Component, signal } from '@angular/core';
} %>
`,<% } else { %>
templateUrl: './app<%= suffix %>.html',<% } %>
standalone: false,<% if(inlineStyle) { %>
styles: []<% } else { %>
styleUrl: './app<%= suffix %>.<%= style %>'<% } %>
})
export class App {
protected readonly title = signal('<%= name %>');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { NgModule, provideBrowserGlobalErrorListeners<% if(!zoneless) { %>, provideZoneChangeDetection<% } %> } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
<% if (routing) { %>
import { NgModule, provideBrowserGlobalErrorListeners<% if (!zoneless) { %>, provideZoneChangeDetection<% } %> } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';<% if (routing) { %>
import { AppRoutingModule } from './app-routing<%= typeSeparator %>module';<% } %>
import { App } from './app<%= suffix %>';

Expand All @@ -13,7 +12,7 @@ import { App } from './app<%= suffix %>';
AppRoutingModule<% } %>
],
providers: [
provideBrowserGlobalErrorListeners(),<% if(!zoneless) { %>
provideBrowserGlobalErrorListeners(),<% if (!zoneless) { %>
provideZoneChangeDetection({ eventCoalescing: true }),<% } %>
],
bootstrap: [App]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<% if(!!viewEncapsulation) { %>import { ViewEncapsulation } from '@angular/core';
<% }%>import { platformBrowser } from '@angular/platform-browser';
<% if (!!viewEncapsulation) { %>import { ViewEncapsulation } from '@angular/core';
<% } %>import { platformBrowser } from '@angular/platform-browser';
import { AppModule } from './app/app<%= typeSeparator %>module';

platformBrowser().bootstrapModule(AppModule, {
<% if(!!viewEncapsulation) { %> defaultEncapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } %>
<% if (!!viewEncapsulation) { %> defaultEncapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } %>
})
.catch(err => console.error(err));
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { ApplicationConfig, provideBrowserGlobalErrorListeners<% if(!zoneless) { %>, provideZoneChangeDetection<% } %> } from '@angular/core';<% if (routing) { %>
import { ApplicationConfig, provideBrowserGlobalErrorListeners<% if (!zoneless) { %>, provideZoneChangeDetection<% } %> } from '@angular/core';<% if (routing) { %>
import { provideRouter } from '@angular/router';

import { routes } from './app.routes';<% } %>

export const appConfig: ApplicationConfig = {
providers: [
provideBrowserGlobalErrorListeners(),<% if(!zoneless) { %>
provideBrowserGlobalErrorListeners(),<% if (!zoneless) { %>
provideZoneChangeDetection({ eventCoalescing: true }),<% } %>
<% if (routing) {%>provideRouter(routes)<% } %>
<% if (routing) { %>provideRouter(routes)<% } %>
]
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ describe('App', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [App],
}).compileComponents();
})
.compileComponents();
});

it('should create the app', () => {
Expand All @@ -14,7 +15,7 @@ describe('App', () => {
expect(app).toBeTruthy();
});

it('should render title', <% if(zoneless) { %>async <% } %>() => {
it('should render title', <% if (zoneless) { %>async <% } %>() => {
const fixture = TestBed.createComponent(App);
<%= zoneless ? 'await fixture.whenStable();' : 'fixture.detectChanges();' %>
const compiled = fixture.nativeElement as HTMLElement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Component, signal } from '@angular/core';<% if(routing) { %>
import { Component, signal } from '@angular/core';<% if (routing) { %>
import { RouterOutlet } from '@angular/router';<% } %>

@Component({
selector: '<%= selector %>',
imports: [<% if(routing) { %>RouterOutlet<% } %>],<% if(inlineTemplate) { %>
imports: [<% if (routing) { %>RouterOutlet<% } %>],
selector: '<%= selector %>',<% if (inlineStyle) { %>
styles: [],<% } else { %>
styleUrl: './app<%= suffix %>.<%= style %>',<% } %><% if (inlineTemplate) { %>
template: `
<h1>Hello, {{ title() }}</h1>

<% if (routing) {
%><router-outlet /><%
} %>
`,<% } else { %>
templateUrl: './app<%= suffix %>.html',<% } if(inlineStyle) { %>
styles: [],<% } else { %>
styleUrl: './app<%= suffix %>.<%= style %>'<% } %>
templateUrl: './app<%= suffix %>.html',<% } %>
})
export class App {
protected readonly title = signal('<%= name %>');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if(displayBlock){ if(style != 'sass') { %>:host {
<% if (displayBlock) { if (style != 'sass') { %>:host {
display: block;
}
<% } else { %>\:host
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import <% if(!exportDefault) { %>{ <% }%><%= classifiedName %> <% if(!exportDefault) {%>} <% }%>from './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>';
import <% if (!exportDefault) { %>{ <% } %><%= classifiedName %> <% if (!exportDefault) { %>} <% } %>from './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>';

describe('<%= classifiedName %>', () => {
let component: <%= classifiedName %>;
Expand All @@ -10,7 +9,7 @@ describe('<%= classifiedName %>', () => {
await TestBed.configureTestingModule({
<%= standalone ? 'imports' : 'declarations' %>: [<%= classifiedName %>]
})
.compileComponents();
.compileComponents();

fixture = TestBed.createComponent(<%= classifiedName %>);
component = fixture.componentInstance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import { <% if(changeDetection !== 'OnPush') { %>ChangeDetectionStrategy, <% }%>Component<% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%> } from '@angular/core';
import { <% if (changeDetection !== 'OnPush') { %>ChangeDetectionStrategy, <% } %>Component<% if (!!viewEncapsulation) { %>, ViewEncapsulation<% } %> } from '@angular/core';

@Component({<% if(!skipSelector) {%>
selector: '<%= selector %>',<%}%><% if(standalone) {%>
imports: [],<%} else { %>
standalone: false,<% }%><% if(inlineTemplate) { %>
@Component({<% if (changeDetection !== 'OnPush') { %>
changeDetection: ChangeDetectionStrategy.<%= changeDetection %>,<% } %><% if (!!viewEncapsulation) { %>
encapsulation: ViewEncapsulation.<%= viewEncapsulation %>,<% } %><% if (standalone) { %>
imports: [],<% } %><% if (!skipSelector) { %>
selector: '<%= selector %>',<% } %><% if (!standalone) { %>
standalone: false,<% } %><% if (inlineStyle) { %>
styles: `<% if (displayBlock) { %>
:host {
display: block;
}
<% } %>`,<% } else if (style !== 'none') { %>
styleUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>.<%= style %>',<% } %><% if (inlineTemplate) { %>
template: `
<p>
<%= dasherize(name) %> works!
</p>
`,<% } else { %>
templateUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %><%= ngext %>.html',<% } if(inlineStyle) { %>
styles: `<% if(displayBlock){ %>
:host {
display: block;
}
<% } %>`,<% } else if (style !== 'none') { %>
styleUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>.<%= style %>',<% } %><% if(!!viewEncapsulation) { %>
encapsulation: ViewEncapsulation.<%= viewEncapsulation %>,<% } if (changeDetection !== 'OnPush') { %>
changeDetection: ChangeDetectionStrategy.<%= changeDetection %>,<% } %>
templateUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %><%= ngext %>.html',<% } %>
})
export <% if(exportDefault) {%>default <%}%>class <%= classifiedName %> {

export <% if (exportDefault) { %>default <% } %>class <%= classifiedName %> {
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Directive } from '@angular/core';

@Directive({
selector: '[<%= selector %>]',<% if(!standalone) {%>
standalone: false,<%}%>
selector: '[<%= selector %>]',<% if (!standalone) { %>
standalone: false,<% } %>
})
export class <%= classifiedName %> {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TestBed } from '@angular/core/testing';

import { <%= classify(name) %>Guard } from './<%= dasherize(name) %><%= typeSeparator %>guard';

describe('<%= classify(name) %>Guard', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { TestBed } from '@angular/core/testing';
import { <%= guardType %> } from '@angular/router';

import { <%= camelize(name) %>Guard } from './<%= dasherize(name) %><%= typeSeparator %>guard';

describe('<%= camelize(name) %>Guard', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TestBed } from '@angular/core/testing';

import { <%= classify(name) %>Interceptor } from './<%= dasherize(name) %><%= typeSeparator %>interceptor';

describe('<%= classify(name) %>Interceptor', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import { Observable } from 'rxjs';

@Injectable()
export class <%= classify(name) %>Interceptor implements HttpInterceptor {

constructor() {}

intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
return next.handle(request);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { TestBed } from '@angular/core/testing';
import { HttpInterceptorFn } from '@angular/common/http';

import { <%= camelize(name) %>Interceptor } from './<%= dasherize(name) %><%= typeSeparator %>interceptor';

describe('<%= camelize(name) %>Interceptor', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Pipe, PipeTransform } from '@angular/core';

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

transform(value: unknown, ...args: unknown[]): unknown {
return null;
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TestBed } from '@angular/core/testing';

import { <%= classify(name) %>Resolver } from './<%= dasherize(name) %><%= typeSeparator %>resolver';

describe('<%= classify(name) %>Resolver', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { TestBed } from '@angular/core/testing';
import { ResolveFn } from '@angular/router';

import { <%= camelize(name) %>Resolver } from './<%= dasherize(name) %><%= typeSeparator %>resolver';

describe('<%= camelize(name) %>Resolver', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { NgModule } from '@angular/core';
import { ServerModule } from '@angular/platform-server';

import { <%= appModuleName %> } from '<%= appModulePath %>';
import { <%= appComponentName %> } from '<%= appComponentPath %>';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TestBed } from '@angular/core/testing';

import { <%= classifiedName %> } from './<%= dasherize(name) %><%= type ? '.' + dasherize(type) : '' %>';

describe('<%= classifiedName %>', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ import { <%= injectable ? 'Injectable' : 'Service' %> } from '@angular/core';
providedIn: 'root',
})<% } else { %>@Service()<% } %>
export class <%= classifiedName %> {

}
Loading