Primeiro commit do projeto Angular
This commit is contained in:
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
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) { %>
|
||||
provideZoneChangeDetection({ eventCoalescing: true }),<% } %>
|
||||
<% if (routing) {%>provideRouter(routes)<% } %>
|
||||
]
|
||||
};
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import { Routes } from '@angular/router';
|
||||
|
||||
export const routes: Routes = [];
|
||||
Generated
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { App } from './app<%= suffix %>';
|
||||
|
||||
describe('App', () => {
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [App],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
it('should create the app', () => {
|
||||
const fixture = TestBed.createComponent(App);
|
||||
const app = fixture.componentInstance;
|
||||
expect(app).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should render title', <% if(zoneless) { %>async <% } %>() => {
|
||||
const fixture = TestBed.createComponent(App);
|
||||
<%= zoneless ? 'await fixture.whenStable();' : 'fixture.detectChanges();' %>
|
||||
const compiled = fixture.nativeElement as HTMLElement;
|
||||
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, <%= name %>');
|
||||
});
|
||||
});
|
||||
Generated
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
import { Component, signal } from '@angular/core';<% if(routing) { %>
|
||||
import { RouterOutlet } from '@angular/router';<% } %>
|
||||
|
||||
@Component({
|
||||
selector: '<%= selector %>',
|
||||
imports: [<% if(routing) { %>RouterOutlet<% } %>],<% if(inlineTemplate) { %>
|
||||
template: `
|
||||
<h1>Hello, {{ title() }}</h1>
|
||||
|
||||
<% if (routing) {
|
||||
%><router-outlet /><%
|
||||
} %>
|
||||
`,<% } else { %>
|
||||
templateUrl: './app<%= suffix %>.html',<% } if(inlineStyle) { %>
|
||||
styles: [],<% } else { %>
|
||||
styleUrl: './app<%= suffix %>.<%= style %>'<% } %>
|
||||
})
|
||||
export class App {
|
||||
protected readonly title = signal('<%= name %>');
|
||||
}
|
||||
Generated
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { appConfig } from './app/app.config';
|
||||
import { App } from './app/app<%= suffix %>';
|
||||
|
||||
bootstrapApplication(App, appConfig)
|
||||
.catch((err) => console.error(err));
|
||||
Reference in New Issue
Block a user