diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f7b5e9b..2250bcd 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,9 +1,12 @@ import { Component, OnInit } from '@angular/core'; import { PrimeNGConfig } from 'primeng/api'; +import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', - templateUrl: './app.component.html' + templateUrl: './app.component.html', + standalone: true, + imports: [RouterOutlet] }) export class AppComponent implements OnInit { diff --git a/src/app/app.module.ts b/src/app/app.module.ts deleted file mode 100644 index 7aaaa65..0000000 --- a/src/app/app.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { NgModule } from '@angular/core'; -import { HashLocationStrategy, LocationStrategy } from '@angular/common'; -import { AppComponent } from './app.component'; -import { AppRoutingModule } from './app-routing.module'; - -import { NotfoundComponent } from './demo/components/notfound/notfound.component'; -import { ProductService } from './demo/service/product.service'; -import { CountryService } from './demo/service/country.service'; -import { CustomerService } from './demo/service/customer.service'; -import { EventService } from './demo/service/event.service'; -import { IconService } from './demo/service/icon.service'; -import { NodeService } from './demo/service/node.service'; -import { PhotoService } from './demo/service/photo.service'; - -@NgModule({ - declarations: [AppComponent], - imports: [ - AppRoutingModule, - NotfoundComponent -], - providers: [ - { provide: LocationStrategy, useClass: HashLocationStrategy }, - CountryService, CustomerService, EventService, IconService, NodeService, - PhotoService, ProductService - ], - bootstrap: [AppComponent] -}) -export class AppModule { } diff --git a/src/main.ts b/src/main.ts index c7b673c..7e64151 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,12 +1,30 @@ -import { enableProdMode } from '@angular/core'; +import { enableProdMode, importProvidersFrom } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; -import { AppModule } from './app/app.module'; + import { environment } from './environments/environment'; +import { bootstrapApplication } from '@angular/platform-browser'; +import { AppComponent } from './app/app.component'; +import { AppRoutingModule } from './app/app-routing.module'; +import { ProductService } from './app/demo/service/product.service'; +import { PhotoService } from './app/demo/service/photo.service'; +import { NodeService } from './app/demo/service/node.service'; +import { IconService } from './app/demo/service/icon.service'; +import { EventService } from './app/demo/service/event.service'; +import { CustomerService } from './app/demo/service/customer.service'; +import { CountryService } from './app/demo/service/country.service'; +import { LocationStrategy, HashLocationStrategy } from '@angular/common'; if (environment.production) { enableProdMode(); } -platformBrowserDynamic().bootstrapModule(AppModule) +bootstrapApplication(AppComponent, { + providers: [ + importProvidersFrom(AppRoutingModule), + { provide: LocationStrategy, useClass: HashLocationStrategy }, + CountryService, CustomerService, EventService, IconService, NodeService, + PhotoService, ProductService + ] +}) .catch(err => console.error(err));