Skip to content

Commit

Permalink
stackblitz service provider fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Dec 18, 2023
1 parent 1d0ce63 commit 051cd62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/app/showcase/doc/table/virtualscrolllazydoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ import { LazyLoadEvent } from 'primeng/api';
import { Car } from '../../domain/car';
import { CarService } from '../../service/carservice';
interface Column {
field: string;
header: string;
}
@Component({
selector: 'table-virtual-scroll-lazy-demo',
templateUrl: 'table-virtual-scroll-lazy-demo.html'
Expand Down
4 changes: 2 additions & 2 deletions src/app/showcase/layout/doc/codeeditor/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ const getAngularApp = (props: Props = {}) => {
const serviceImports = code.service ? getServiceImports(code.service) : '';
const routerModule = code.routerModule ? code.routerModule : `RouterModule.forRoot([{ path: '', component: ${componentName} }])`;
const declarations = routeFiles && routeFiles.length ? (componentName ? routeFiles.map((r) => r.name).join(', ') + ',' + componentName : routeFiles.map((r) => r.name).join(', ')) : `${componentName}`;

const providers = ['MessageService', ...(code.service ? [code.service] : [])];
const app_module_ts = `import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
Expand Down Expand Up @@ -696,7 +696,7 @@ ${serviceImports}
${routerModule}],
declarations: [ ${declarations} ],
bootstrap: [ ${componentName} ],
providers: [ MessageService ]
providers: [ ${providers} ]
})
export class AppModule {}`;
Expand Down

0 comments on commit 051cd62

Please sign in to comment.