diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 4fa4014..32ae09d 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -3,10 +3,8 @@ import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ - AppComponent - ], - }).compileComponents(); + imports: [AppComponent], +}).compileComponents(); })); it('should create the app', async(() => { const fixture = TestBed.createComponent(AppComponent); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1d4c9df..90f17c4 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,11 +1,13 @@ import { Component } from '@angular/core'; import { FormioAuthService } from '@formio/angular/auth'; +import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router'; +import { NgIf } from '@angular/common'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], - standalone: false + imports: [RouterLink, RouterLinkActive, NgIf, RouterOutlet] }) export class AppComponent { constructor(public auth: FormioAuthService) {} diff --git a/src/app/app.module.ts b/src/app/app.module.ts deleted file mode 100644 index 0c4dad1..0000000 --- a/src/app/app.module.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; -import { Formio, FormioModule, FormioAppConfig } from '@formio/angular'; -// import premium from '@formio/premium'; -// Formio.use(premium); -import { FormioGrid } from '@formio/angular/grid'; -import { FormioAuthService, FormioAuthConfig } from '@formio/angular/auth'; -import { FormioResources } from '@formio/angular/resource'; -import { PrismService } from './Prism.service'; - -import { AppConfig } from './config'; -import { AppComponent } from './app.component'; -import { HomeComponent } from './home/home.component'; -import { DataComponent } from './data/data.component'; -import { CustomSubmissionGridHeaderComponent } from './data/submission/SubmissionGridHeader.component'; - -// Make sure we use fontawesome everywhere in Form.io renderers. -(Formio as any).icons = 'fontawesome'; - -/** - * Import the Custom component CheckMatrix. - */ -// import './components/CheckMatrix'; - -@NgModule({ - declarations: [ - AppComponent, - HomeComponent, - DataComponent, - CustomSubmissionGridHeaderComponent - ], - imports: [ - BrowserModule, - CommonModule, - FormioModule, - FormioGrid, - RouterModule.forRoot([ - { - path: '', - component: HomeComponent - }, - { - path: 'data', - component: DataComponent - }, - { - path: 'forms', - loadChildren: () => import('./forms/forms.module').then(m => m.FormsModule) - }, - { - path: 'auth', - loadChildren: () => import('./auth/auth.module').then(m => m.AuthModule) - }, - { - path: 'event', - loadChildren: () => import('./event/event.module').then(m => m.EventModule) - }, - { - path: 'manager', - loadChildren: () => import('./form/form.module').then(m => m.FormModule) - } - ], {useHash: true}) - ], - providers: [ - PrismService, - FormioAuthService, - FormioResources, - {provide: FormioAppConfig, useValue: AppConfig}, - {provide: FormioAuthConfig, useValue: { - login: { - form: 'user/login' - }, - register: { - form: 'user/register' - } - }} - ], - bootstrap: [AppComponent] -}) -export class AppModule { } diff --git a/src/app/auth/auth.module.ts b/src/app/auth/auth.module.ts index eb6afcf..41cafc5 100644 --- a/src/app/auth/auth.module.ts +++ b/src/app/auth/auth.module.ts @@ -12,12 +12,12 @@ export const authRoutes = FormioAuthRoutes({ }); @NgModule({ - imports: [ - CommonModule, - FormioModule, - FormioAuth, - RouterModule.forChild(authRoutes) - ], - declarations: [AuthComponent, LoginComponent] + imports: [ + CommonModule, + FormioModule, + FormioAuth, + RouterModule.forChild(authRoutes), + AuthComponent, LoginComponent + ] }) export class AuthModule { } diff --git a/src/app/auth/auth/auth.component.spec.ts b/src/app/auth/auth/auth.component.spec.ts index 884576c..d72d408 100644 --- a/src/app/auth/auth/auth.component.spec.ts +++ b/src/app/auth/auth/auth.component.spec.ts @@ -8,8 +8,8 @@ describe('AuthComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AuthComponent ] - }) + imports: [AuthComponent] +}) .compileComponents(); })); diff --git a/src/app/auth/auth/auth.component.ts b/src/app/auth/auth/auth.component.ts index 7ec54da..b78e8c1 100644 --- a/src/app/auth/auth/auth.component.ts +++ b/src/app/auth/auth/auth.component.ts @@ -1,10 +1,12 @@ import { Component } from '@angular/core'; import { FormioAuthComponent, FormioAuthService } from '@formio/angular/auth'; +import { NgIf } from '@angular/common'; +import { RouterLinkActive, RouterLink, RouterOutlet } from '@angular/router'; @Component({ selector: 'app-auth', templateUrl: './auth.component.html', styleUrls: ['./auth.component.scss'], - standalone: false + imports: [NgIf, RouterLinkActive, RouterLink, RouterOutlet] }) export class AuthComponent extends FormioAuthComponent { constructor(public service: FormioAuthService) { diff --git a/src/app/auth/login/login.component.spec.ts b/src/app/auth/login/login.component.spec.ts index d6d85a8..dc46ff1 100644 --- a/src/app/auth/login/login.component.spec.ts +++ b/src/app/auth/login/login.component.spec.ts @@ -8,8 +8,8 @@ describe('LoginComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoginComponent ] - }) + imports: [LoginComponent] +}) .compileComponents(); })); diff --git a/src/app/auth/login/login.component.ts b/src/app/auth/login/login.component.ts index 8fad344..bfb3c39 100644 --- a/src/app/auth/login/login.component.ts +++ b/src/app/auth/login/login.component.ts @@ -1,10 +1,11 @@ import { Component } from '@angular/core'; import { FormioAuthLoginComponent, FormioAuthService } from '@formio/angular/auth'; +import { FormioComponent } from '@formio/angular'; @Component({ selector: 'app-login', templateUrl: './login.component.html', styleUrls: ['./login.component.scss'], - standalone: false + imports: [FormioComponent] }) export class LoginComponent extends FormioAuthLoginComponent { constructor(public service: FormioAuthService) { diff --git a/src/app/data/data.component.spec.ts b/src/app/data/data.component.spec.ts index 9001296..d2ba7c3 100644 --- a/src/app/data/data.component.spec.ts +++ b/src/app/data/data.component.spec.ts @@ -8,8 +8,8 @@ describe('DataComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DataComponent ] - }) + imports: [DataComponent] +}) .compileComponents(); })); diff --git a/src/app/data/data.component.ts b/src/app/data/data.component.ts index ff5891b..0a0af23 100644 --- a/src/app/data/data.component.ts +++ b/src/app/data/data.component.ts @@ -3,12 +3,13 @@ import { FormioAppConfig } from '@formio/angular'; import { FormioAuthService } from '@formio/angular/auth'; import SubmissionComponents from './submission/index'; import { PrismService } from '../Prism.service'; +import { FormioGridComponent } from '@formio/angular/grid'; @Component({ selector: 'app-data', templateUrl: './data.component.html', styleUrls: ['./data.component.scss'], encapsulation: ViewEncapsulation.None, - standalone: false + imports: [FormioGridComponent] }) export class DataComponent implements AfterViewInit { diff --git a/src/app/data/submission/SubmissionGridHeader.component.ts b/src/app/data/submission/SubmissionGridHeader.component.ts index d81e8ca..b640e11 100644 --- a/src/app/data/submission/SubmissionGridHeader.component.ts +++ b/src/app/data/submission/SubmissionGridHeader.component.ts @@ -1,8 +1,9 @@ import { Component } from "@angular/core"; import { SubmissionGridHeaderComponent } from "@formio/angular/grid"; +import { NgFor, NgIf, NgClass } from "@angular/common"; @Component({ templateUrl: './SubmissionGridHeader.component.html', - standalone: false + imports: [NgFor, NgIf, NgClass] }) export class CustomSubmissionGridHeaderComponent extends SubmissionGridHeaderComponent {} diff --git a/src/app/event/event.module.ts b/src/app/event/event.module.ts index cec51c0..cf1bb5f 100644 --- a/src/app/event/event.module.ts +++ b/src/app/event/event.module.ts @@ -15,58 +15,58 @@ import { } from '@formio/angular/resource'; @NgModule({ - imports: [ - CommonModule, - FormioModule, - FormioResource, - RouterModule.forChild([ - { - path: '', - component: FormioResourceIndexComponent - }, - { - path: 'new', - component: FormioResourceCreateComponent - }, + imports: [ + CommonModule, + FormioModule, + FormioResource, + RouterModule.forChild([ + { + path: '', + component: FormioResourceIndexComponent + }, + { + path: 'new', + component: FormioResourceCreateComponent + }, + { + path: ':id', + component: ResourceComponent, + children: [ + { + path: '', + redirectTo: 'view', + pathMatch: 'full' + }, + { + path: 'view', + component: ViewComponent + }, + { + path: 'edit', + component: FormioResourceEditComponent + }, + { + path: 'delete', + component: FormioResourceDeleteComponent + }, + { + path: 'participant', + loadChildren: () => import('./participant/participant.module').then(x => x.ParticipantModule) + } + ] + } + ]), + ResourceComponent, ViewComponent + ], + providers: [ + FormioResourceService, { - path: ':id', - component: ResourceComponent, - children: [ - { - path: '', - redirectTo: 'view', - pathMatch: 'full' - }, - { - path: 'view', - component: ViewComponent - }, - { - path: 'edit', - component: FormioResourceEditComponent - }, - { - path: 'delete', - component: FormioResourceDeleteComponent - }, - { - path: 'participant', - loadChildren: () => import('./participant/participant.module').then(x => x.ParticipantModule) - } - ] + provide: FormioResourceConfig, + useValue: { + name: 'event', + form: 'event' + } } - ]) - ], - declarations: [ResourceComponent, ViewComponent], - providers: [ - FormioResourceService, - { - provide: FormioResourceConfig, - useValue: { - name: 'event', - form: 'event' - } - } - ] + ] }) export class EventModule { } diff --git a/src/app/event/resource/resource.component.spec.ts b/src/app/event/resource/resource.component.spec.ts index ee7a3b8..a8151df 100644 --- a/src/app/event/resource/resource.component.spec.ts +++ b/src/app/event/resource/resource.component.spec.ts @@ -8,8 +8,8 @@ describe('ResourceComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ResourceComponent ] - }) + imports: [ResourceComponent] +}) .compileComponents(); })); diff --git a/src/app/event/resource/resource.component.ts b/src/app/event/resource/resource.component.ts index 7807d87..ecd6544 100644 --- a/src/app/event/resource/resource.component.ts +++ b/src/app/event/resource/resource.component.ts @@ -1,10 +1,11 @@ import { Component } from '@angular/core'; import { FormioResourceComponent } from '@formio/angular/resource'; +import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router'; @Component({ selector: 'app-resource', templateUrl: './resource.component.html', styleUrls: ['./resource.component.scss'], - standalone: false + imports: [RouterLink, RouterLinkActive, RouterOutlet] }) export class ResourceComponent extends FormioResourceComponent {} diff --git a/src/app/event/view/view.component.spec.ts b/src/app/event/view/view.component.spec.ts index 6cc48d4..8e418c2 100644 --- a/src/app/event/view/view.component.spec.ts +++ b/src/app/event/view/view.component.spec.ts @@ -8,8 +8,8 @@ describe('ViewComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewComponent ] - }) + imports: [ViewComponent] +}) .compileComponents(); })); diff --git a/src/app/event/view/view.component.ts b/src/app/event/view/view.component.ts index f90ba78..5155f77 100644 --- a/src/app/event/view/view.component.ts +++ b/src/app/event/view/view.component.ts @@ -1,10 +1,12 @@ import { Component } from '@angular/core'; import { FormioResourceViewComponent } from '@formio/angular/resource'; +import { RouterLink } from '@angular/router'; +import { DatePipe } from '@angular/common'; @Component({ selector: 'app-view', templateUrl: './view.component.html', styleUrls: ['./view.component.scss'], - standalone: false + imports: [RouterLink, DatePipe] }) export class ViewComponent extends FormioResourceViewComponent {} diff --git a/src/app/form/form.module.ts b/src/app/form/form.module.ts index cc73e27..d5913da 100644 --- a/src/app/form/form.module.ts +++ b/src/app/form/form.module.ts @@ -6,22 +6,20 @@ import { FormManagerModule, FormManagerRoutes, FormManagerService, FormManagerCo import { IndexComponent } from './index/index.component'; @NgModule({ - imports: [ - CommonModule, - FormioGrid, - FormManagerModule, - RouterModule.forChild(FormManagerRoutes({ - formIndex: IndexComponent - })) - ], - declarations: [ - IndexComponent - ], - providers: [ - FormManagerService, - {provide: FormManagerConfig, useValue: { - tag: 'common' - }} - ] + imports: [ + CommonModule, + FormioGrid, + FormManagerModule, + RouterModule.forChild(FormManagerRoutes({ + formIndex: IndexComponent + })), + IndexComponent + ], + providers: [ + FormManagerService, + { provide: FormManagerConfig, useValue: { + tag: 'common' + } } + ] }) export class FormModule { } diff --git a/src/app/form/index/index.component.spec.ts b/src/app/form/index/index.component.spec.ts index 0312242..6fc2295 100644 --- a/src/app/form/index/index.component.spec.ts +++ b/src/app/form/index/index.component.spec.ts @@ -8,8 +8,8 @@ describe('IndexComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ IndexComponent ] - }) + imports: [IndexComponent] +}) .compileComponents(); })); diff --git a/src/app/form/index/index.component.ts b/src/app/form/index/index.component.ts index 2729e85..873307f 100644 --- a/src/app/form/index/index.component.ts +++ b/src/app/form/index/index.component.ts @@ -1,13 +1,15 @@ import { Component } from '@angular/core'; -import { Router, ActivatedRoute } from '@angular/router'; +import { Router, ActivatedRoute, RouterLink } from '@angular/router'; import { FormManagerIndexComponent, FormManagerService, FormManagerConfig } from '@formio/angular/manager'; import { FormioAuthService } from '@formio/angular/auth'; +import { NgIf } from '@angular/common'; +import { FormioGridComponent } from '@formio/angular/grid'; @Component({ selector: 'app-index', templateUrl: './index.component.html', styleUrls: ['./index.component.scss'], - standalone: false + imports: [NgIf, RouterLink, FormioGridComponent] }) export class IndexComponent extends FormManagerIndexComponent { constructor( diff --git a/src/app/forms/builder/builder.component.spec.ts b/src/app/forms/builder/builder.component.spec.ts index 126bf18..bc8a390 100644 --- a/src/app/forms/builder/builder.component.spec.ts +++ b/src/app/forms/builder/builder.component.spec.ts @@ -8,8 +8,8 @@ describe('BuilderComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ BuilderComponent ] - }) + imports: [BuilderComponent] +}) .compileComponents(); })); diff --git a/src/app/forms/builder/builder.component.ts b/src/app/forms/builder/builder.component.ts index f69be4a..9287d28 100644 --- a/src/app/forms/builder/builder.component.ts +++ b/src/app/forms/builder/builder.component.ts @@ -1,4 +1,4 @@ -import { FormioRefreshValue } from '@formio/angular'; +import { FormioRefreshValue, FormBuilderComponent, FormioComponent } from '@formio/angular'; import { Component, AfterViewInit, ViewChild, ElementRef, EventEmitter } from '@angular/core'; import { PrismService } from '../../Prism.service'; @@ -6,7 +6,7 @@ import { PrismService } from '../../Prism.service'; selector: 'app-builder', templateUrl: './builder.component.html', styleUrls: ['./builder.component.scss'], - standalone: false + imports: [FormBuilderComponent, FormioComponent] }) export class BuilderComponent implements AfterViewInit { @ViewChild('json', {static: true}) jsonElement?: ElementRef; diff --git a/src/app/forms/custom-builder/builder.component.ts b/src/app/forms/custom-builder/builder.component.ts index 6b3638c..33cc11f 100644 --- a/src/app/forms/custom-builder/builder.component.ts +++ b/src/app/forms/custom-builder/builder.component.ts @@ -2,11 +2,12 @@ import { Component, AfterViewInit, ViewChild, ElementRef } from '@angular/core'; import { PrismService } from '../../Prism.service'; import { options } from './options'; import {Observable, Subject} from "rxjs"; +import { FormBuilderComponent } from '@formio/angular'; @Component({ selector: 'app-builder', templateUrl: './builder.component.html', - standalone: false + imports: [FormBuilderComponent] }) export class CustomBuilderComponent implements AfterViewInit { @ViewChild('json', {static: true}) jsonElement?: ElementRef; diff --git a/src/app/forms/forms.module.ts b/src/app/forms/forms.module.ts index 911ff57..6fddedf 100644 --- a/src/app/forms/forms.module.ts +++ b/src/app/forms/forms.module.ts @@ -14,28 +14,26 @@ import { FormsComponent } from './forms/forms.component'; import { FORMS } from './forms.index'; @NgModule({ - imports: [ - CommonModule, - FormioModule, - RouterModule.forChild([{ - path: '', - component: FormsComponent, - children: FORMS - }]) - ], - declarations: [ - CustomBuilderComponent, - BuilderComponent, - KitchenComponent, - LanguageComponent, - PdfComponent, - RendererComponent, - SimpleComponent, - WizardComponent, - FormsComponent - ], - bootstrap: [ - FormsComponent - ] + imports: [ + CommonModule, + FormioModule, + RouterModule.forChild([{ + path: '', + component: FormsComponent, + children: FORMS + }]), + CustomBuilderComponent, + BuilderComponent, + KitchenComponent, + LanguageComponent, + PdfComponent, + RendererComponent, + SimpleComponent, + WizardComponent + ], + declarations: [FormsComponent], + bootstrap: [ + FormsComponent + ] }) export class FormsModule { } diff --git a/src/app/forms/forms/forms.component.spec.ts b/src/app/forms/forms/forms.component.spec.ts index 006d4ce..a580c5c 100644 --- a/src/app/forms/forms/forms.component.spec.ts +++ b/src/app/forms/forms/forms.component.spec.ts @@ -8,8 +8,8 @@ describe('FormsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FormsComponent ] - }) + declarations: [FormsComponent] +}) .compileComponents(); })); diff --git a/src/app/forms/kitchen/kitchen.component.spec.ts b/src/app/forms/kitchen/kitchen.component.spec.ts index 19f8e09..6fe503a 100644 --- a/src/app/forms/kitchen/kitchen.component.spec.ts +++ b/src/app/forms/kitchen/kitchen.component.spec.ts @@ -8,8 +8,8 @@ describe('KitchenComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ KitchenComponent ] - }) + imports: [KitchenComponent] +}) .compileComponents(); })); diff --git a/src/app/forms/kitchen/kitchen.component.ts b/src/app/forms/kitchen/kitchen.component.ts index cf5739c..b2b8e47 100644 --- a/src/app/forms/kitchen/kitchen.component.ts +++ b/src/app/forms/kitchen/kitchen.component.ts @@ -1,10 +1,11 @@ import { Component } from '@angular/core'; import { FORM } from './form'; +import { FormioComponent } from '@formio/angular'; @Component({ selector: 'app-kitchen', templateUrl: './kitchen.component.html', styleUrls: ['./kitchen.component.scss'], - standalone: false + imports: [FormioComponent] }) export class KitchenComponent { public form: any = FORM; diff --git a/src/app/forms/language/language.component.spec.ts b/src/app/forms/language/language.component.spec.ts index 39043b9..5ba335f 100644 --- a/src/app/forms/language/language.component.spec.ts +++ b/src/app/forms/language/language.component.spec.ts @@ -8,8 +8,8 @@ describe('LanguageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LanguageComponent ] - }) + imports: [LanguageComponent] +}) .compileComponents(); })); diff --git a/src/app/forms/language/language.component.ts b/src/app/forms/language/language.component.ts index 880d643..27a40cd 100644 --- a/src/app/forms/language/language.component.ts +++ b/src/app/forms/language/language.component.ts @@ -1,12 +1,12 @@ import { Component, EventEmitter } from '@angular/core'; -import { AngularFormioOptions, FormioAppConfig } from '@formio/angular'; +import { AngularFormioOptions, FormioAppConfig, FormioComponent } from '@formio/angular'; import { Webform } from "@formio/js"; @Component({ selector: 'app-language', templateUrl: './language.component.html', styleUrls: ['./language.component.scss'], - standalone: false + imports: [FormioComponent] }) export class LanguageComponent { public language: EventEmitter; diff --git a/src/app/forms/pdf/pdf.component.spec.ts b/src/app/forms/pdf/pdf.component.spec.ts index a8c38e3..4240ce2 100644 --- a/src/app/forms/pdf/pdf.component.spec.ts +++ b/src/app/forms/pdf/pdf.component.spec.ts @@ -8,8 +8,8 @@ describe('PdfComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PdfComponent ] - }) + imports: [PdfComponent] +}) .compileComponents(); })); diff --git a/src/app/forms/pdf/pdf.component.ts b/src/app/forms/pdf/pdf.component.ts index 02ade38..277c40e 100644 --- a/src/app/forms/pdf/pdf.component.ts +++ b/src/app/forms/pdf/pdf.component.ts @@ -1,10 +1,10 @@ import { Component, OnInit } from '@angular/core'; -import { FormioAppConfig } from '@formio/angular'; +import { FormioAppConfig, FormioComponent } from '@formio/angular'; @Component({ selector: 'app-pdf', templateUrl: './pdf.component.html', styleUrls: ['./pdf.component.scss'], - standalone: false + imports: [FormioComponent] }) export class PdfComponent implements OnInit { constructor(public config: FormioAppConfig) {} diff --git a/src/app/forms/renderer/renderer.component.spec.ts b/src/app/forms/renderer/renderer.component.spec.ts index af23816..bf66399 100644 --- a/src/app/forms/renderer/renderer.component.spec.ts +++ b/src/app/forms/renderer/renderer.component.spec.ts @@ -8,8 +8,8 @@ describe('RendererComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RendererComponent ] - }) + imports: [RendererComponent] +}) .compileComponents(); })); diff --git a/src/app/forms/renderer/renderer.component.ts b/src/app/forms/renderer/renderer.component.ts index 206a765..7e8d93b 100644 --- a/src/app/forms/renderer/renderer.component.ts +++ b/src/app/forms/renderer/renderer.component.ts @@ -1,11 +1,12 @@ import { Component, AfterViewInit } from '@angular/core'; import { PrismService } from '../../Prism.service'; +import { FormioComponent } from '@formio/angular'; @Component({ selector: 'app-renderer', templateUrl: './renderer.component.html', styleUrls: ['./renderer.component.scss'], - standalone: false + imports: [FormioComponent] }) export class RendererComponent implements AfterViewInit { diff --git a/src/app/forms/simple/simple.component.spec.ts b/src/app/forms/simple/simple.component.spec.ts index 0c57fca..27e966a 100644 --- a/src/app/forms/simple/simple.component.spec.ts +++ b/src/app/forms/simple/simple.component.spec.ts @@ -8,8 +8,8 @@ describe('SimpleComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SimpleComponent ] - }) + imports: [SimpleComponent] +}) .compileComponents(); })); diff --git a/src/app/forms/simple/simple.component.ts b/src/app/forms/simple/simple.component.ts index 5dec9e1..f2324da 100644 --- a/src/app/forms/simple/simple.component.ts +++ b/src/app/forms/simple/simple.component.ts @@ -1,12 +1,12 @@ import { Component, AfterViewInit } from '@angular/core'; -import { FormioAppConfig } from '@formio/angular'; +import { FormioAppConfig, FormioComponent } from '@formio/angular'; import { PrismService } from '../../Prism.service'; @Component({ selector: 'app-simple', templateUrl: './simple.component.html', styleUrls: ['./simple.component.scss'], - standalone: false + imports: [FormioComponent] }) export class SimpleComponent implements AfterViewInit { constructor( diff --git a/src/app/forms/wizard/wizard.component.spec.ts b/src/app/forms/wizard/wizard.component.spec.ts index b5ec8b2..0d14717 100644 --- a/src/app/forms/wizard/wizard.component.spec.ts +++ b/src/app/forms/wizard/wizard.component.spec.ts @@ -8,8 +8,8 @@ describe('WizardComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WizardComponent ] - }) + imports: [WizardComponent] +}) .compileComponents(); })); diff --git a/src/app/forms/wizard/wizard.component.ts b/src/app/forms/wizard/wizard.component.ts index 2ecda84..73b4f81 100644 --- a/src/app/forms/wizard/wizard.component.ts +++ b/src/app/forms/wizard/wizard.component.ts @@ -1,12 +1,12 @@ import { Component, AfterViewInit } from '@angular/core'; -import { FormioAppConfig } from '@formio/angular'; +import { FormioAppConfig, FormioComponent } from '@formio/angular'; import { PrismService } from '../../Prism.service'; @Component({ selector: 'app-wizard', templateUrl: './wizard.component.html', styleUrls: ['./wizard.component.scss'], - standalone: false + imports: [FormioComponent] }) export class WizardComponent implements AfterViewInit { constructor( diff --git a/src/app/home/home.component.spec.ts b/src/app/home/home.component.spec.ts index 490e81b..4269791 100644 --- a/src/app/home/home.component.spec.ts +++ b/src/app/home/home.component.spec.ts @@ -8,8 +8,8 @@ describe('HomeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ HomeComponent ] - }) + imports: [HomeComponent] +}) .compileComponents(); })); diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index e15f9dc..5b125c6 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -1,11 +1,11 @@ import { Component, AfterViewInit } from '@angular/core'; -import { FormioAppConfig } from '@formio/angular'; +import { FormioAppConfig, FormioComponent } from '@formio/angular'; import { PrismService } from '../Prism.service'; @Component({ selector: 'app-home', templateUrl: './home.component.html', styleUrls: ['./home.component.scss'], - standalone: false + imports: [FormioComponent] }) export class HomeComponent implements AfterViewInit { constructor( diff --git a/src/main.ts b/src/main.ts index 91ec6da..93fb565 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,12 +1,66 @@ -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 { PrismService } from './app/Prism.service'; +import { FormioAuthService, FormioAuthConfig } from '@formio/angular/auth'; +import { FormioResources } from '@formio/angular/resource'; +import { FormioAppConfig, FormioModule } from '@formio/angular'; +import { AppConfig } from './app/config'; +import { BrowserModule, bootstrapApplication } from '@angular/platform-browser'; +import { CommonModule } from '@angular/common'; +import { FormioGrid } from '@formio/angular/grid'; +import { withHashLocation, provideRouter } from '@angular/router'; +import { HomeComponent } from './app/home/home.component'; +import { DataComponent } from './app/data/data.component'; +import { AppComponent } from './app/app.component'; if (environment.production) { enableProdMode(); } -platformBrowserDynamic().bootstrapModule(AppModule) +bootstrapApplication(AppComponent, { + providers: [ + importProvidersFrom(BrowserModule, CommonModule, FormioModule, FormioGrid), + PrismService, + FormioAuthService, + FormioResources, + { provide: FormioAppConfig, useValue: AppConfig }, + { provide: FormioAuthConfig, useValue: { + login: { + form: 'user/login' + }, + register: { + form: 'user/register' + } + } }, + provideRouter([ + { + path: '', + component: HomeComponent + }, + { + path: 'data', + component: DataComponent + }, + { + path: 'forms', + loadChildren: () => import("./app/forms/forms.module").then(m => m.FormsModule) + }, + { + path: 'auth', + loadChildren: () => import("./app/auth/auth.module").then(m => m.AuthModule) + }, + { + path: 'event', + loadChildren: () => import("./app/event/event.module").then(m => m.EventModule) + }, + { + path: 'manager', + loadChildren: () => import("./app/form/form.module").then(m => m.FormModule) + } + ], withHashLocation()) + ] +}) .catch(err => console.log(err));