Filter bar in Angular TreeGrid component

9 Apr 202424 minutes to read

The filter bar feature provides a user-friendly way to filter data in the Syncfusion Angular Tree Grid. It displays an input field for each column, allowing you to enter filter criteria and instantly see the filtered results.

By defining the allowFiltering to true, then filter bar row will be rendered next to header which allows you to filter data. You can filter the records with different expressions depending upon the column type.

Filter bar expressions:

You can enter the following filter expressions(operators) manually in the filter bar.

Expression Example Description Column Type
= =value equal Number
!= !=value notequal Number
> >value greaterthan Number
< <value lessthan Number
>= >=value greaterthanorequal Number
<= <=value lessthanorequal Number
* *value startswith String
% %value endswith String
N/A N/A Always equal operator will be used for Date filter Date
N/A N/A Always equal operator will be used for Boolean filter Boolean

The following example demonstrates how to activate default filtering in the tree grid.

import { Component, OnInit } from '@angular/core';
import { sampleData } from './datasource';
import { FilterSettingsModel } from '@syncfusion/ej2-angular-grids';

@Component({
    selector: 'app-container',
    template: `<ejs-treegrid [dataSource]='data' height='275' [treeColumnIndex]='1'  [allowFiltering]='true' [filterSettings]='filterSettings' childMapping='subtasks' >
                  <e-columns>
                      <e-column field='taskID' headerText='Task ID' textAlign='Right' width=90></e-column>
                      <e-column field='taskName' headerText='Task Name' textAlign='Left' width=180></e-column>
                      <e-column field='startDate' headerText='Start Date' textAlign='Right' type='date' format='yMd' width=90></e-column>
                      <e-column field='duration' headerText='Duration' textAlign='Right' width=80></e-column>
                  </e-columns>
                </ejs-treegrid>`
})
export class AppComponent implements OnInit {

    public data?: Object[];
    public filterSettings?: FilterSettingsModel;

    ngOnInit(): void {
        this.data = sampleData;
        this.filterSettings = {
          type:'FilterBar'
       }
    }
}
import { NgModule,ViewChild } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { TreeGridModule } from '@syncfusion/ej2-angular-treegrid';
import { PageService, SortService, FilterService } from '@syncfusion/ej2-angular-treegrid';
import { AppComponent } from './app.component';
import {ButtonModule} from '@syncfusion/ej2-angular-buttons';
import { DropDownListAllModule } from '@syncfusion/ej2-angular-dropdowns';
import { FormsModule } from '@angular/forms';

/**
 * Module
 */
@NgModule({
    imports: [
        BrowserModule,
        TreeGridModule,
        ButtonModule,
        DropDownListAllModule,
        FormsModule
    ],
    declarations: [AppComponent],
    bootstrap: [AppComponent],
    providers: [PageService,
                SortService,
                FilterService]
})
export class AppModule { }
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';

import 'zone.js';
enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);

To enable or dynamically switch the filter type, you must set the filterSettings.type as FilterBar.

Filter bar modes

In the TreeGrid component, the filter bar can operate in two different ways when filtering criteria are applied. These modes, “OnEnter Mode” and “Immediate Mode,” provide different experiences and behaviors when interacting with the filter bar. The OnEnter mode is the default mode of the filter bar in the TreeGrid component.

OnEnter Mode:
By settings filterSettings.mode as OnEnter, the filter bar captures the filter criteria entered but doesn’t initiate filtering until the Enter key is pressed. This allows multiple criteria modifications without triggering immediate filtering actions.

Immediate Mode:
By settings filterSettings.mode as Immediate, the filter bar instantly applies filtering as filter criteria are entered. Filtering actions take place as soon as criteria are input or modified, providing real-time previews of filtering results.

The following example illustrates how to enable different filter bar modes in the tree grid.

import { Component, OnInit } from '@angular/core';
import { sampleData } from './datasource';
import { FilterBarMode, FilterSettingsModel } from '@syncfusion/ej2-angular-grids';
import { ChangeEventArgs } from '@syncfusion/ej2-angular-dropdowns'
@Component({
    selector: 'app-container',
    template: `<div class='input-container'>
                    <label for='fields' class='label'>Select Filter Mode</label>
                    <ejs-dropdownlist #field id='fields' [dataSource]='filterModesData' (change)='onModeChange($event)'></ejs-dropdownlist>
                </div>
    
                <ejs-treegrid [dataSource]='data' height='275' [treeColumnIndex]='1'  [allowFiltering]='true' [filterSettings]='filterSettings' childMapping='subtasks' >
                    <e-columns>
                        <e-column field='taskID' headerText='Task ID' textAlign='Right' width=90></e-column>
                        <e-column field='taskName' headerText='Task Name' textAlign='Left' width=180></e-column>
                        <e-column field='startDate' headerText='Start Date' textAlign='Right' type='date' format='yMd' width=90></e-column>
                        <e-column field='duration' headerText='Duration' textAlign='Right' width=80></e-column>
                    </e-columns>
                </ejs-treegrid>`
})
export class AppComponent implements OnInit {

    public data?: Object[];
    public filterSettings?: FilterSettingsModel;
    public filterModesData:any = ['Immediate', 'OnEnter'];

    ngOnInit(): void {
        this.data = sampleData;
        this.filterSettings = {
          type:'FilterBar'
       }
    }
    onModeChange(args: ChangeEventArgs): void {
      this.filterSettings = {
          mode: args.value as FilterBarMode,
      }
  };
}
import { NgModule,ViewChild } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { TreeGridModule } from '@syncfusion/ej2-angular-treegrid';
import { PageService, SortService, FilterService } from '@syncfusion/ej2-angular-treegrid';
import { AppComponent } from './app.component';
import {ButtonModule} from '@syncfusion/ej2-angular-buttons';
import { DropDownListAllModule } from '@syncfusion/ej2-angular-dropdowns';
import { FormsModule } from '@angular/forms';

/**
 * Module
 */
@NgModule({
    imports: [
        BrowserModule,
        TreeGridModule,
        ButtonModule,
        DropDownListAllModule,
        FormsModule
    ],
    declarations: [AppComponent],
    bootstrap: [AppComponent],
    providers: [PageService,
                SortService,
                FilterService]
})
export class AppModule { }
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';

import 'zone.js';
enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);

Display filter text in pager

The TreeGrid component provides an option to display filter text within the pager, indicating the current filtering status. Enabling this feature provides you with a clear understanding of the applied filters and the criteria used for filtering.

To enable the display of filter text within the pager, you should set the showFilterBarStatus property within the filterSettings configuration.

The following example demonstrates how to display the filter text in the pager of the tree grid by using the showFilterBarStatus property:

import { Component, OnInit ,ViewChild} from '@angular/core';
import { sampleData } from './datasource';
import { FilterBarMode, FilterSettingsModel } from '@syncfusion/ej2-angular-grids';
import { TreeGridComponent } from '@syncfusion/ej2-angular-treegrid'
@Component({
    selector: 'app-container',
    template: `<div class='container'>
                    <label for="checked"> <b> Show filter bar status </b> </label>
                    <ejs-switch id="checked" [checked]="true" (change)="onChange($event)"></ejs-switch>
                </div>
    
                <ejs-treegrid #treegrid [dataSource]='data' height='275' [treeColumnIndex]='1' [allowPaging]='true' [allowFiltering]='true' childMapping='subtasks' >
                    <e-columns>
                        <e-column field='taskID' headerText='Task ID' textAlign='Right' width=90></e-column>
                        <e-column field='taskName' headerText='Task Name' textAlign='Left' width=180></e-column>
                        <e-column field='startDate' headerText='Start Date' textAlign='Right' type='date' format='yMd' width=90></e-column>
                        <e-column field='duration' headerText='Duration' textAlign='Right' width=80></e-column>
                    </e-columns>
                </ejs-treegrid>`
})
export class AppComponent implements OnInit {

    public data?: Object[];
   
     @ViewChild('treegrid')
     public treegrid:TreeGridComponent|undefined;
    ngOnInit(): void {
        this.data = sampleData;
        
    }
    onChange(args: any): void {
      (this.treegrid as TreeGridComponent).filterSettings = {
          showFilterBarStatus: args.checked,
      };
  }
}
import { NgModule,ViewChild } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { TreeGridModule } from '@syncfusion/ej2-angular-treegrid';
import { PageService, SortService, FilterService } from '@syncfusion/ej2-angular-treegrid';
import { AppComponent } from './app.component';
import {ButtonModule,SwitchModule} from '@syncfusion/ej2-angular-buttons';
import { DropDownListAllModule } from '@syncfusion/ej2-angular-dropdowns';
import { FormsModule } from '@angular/forms';

/**
 * Module
 */
@NgModule({
    imports: [
        BrowserModule,
        TreeGridModule,SwitchModule,
        ButtonModule,
        DropDownListAllModule,
        FormsModule
    ],
    declarations: [AppComponent],
    bootstrap: [AppComponent],
    providers: [PageService,
                SortService,
                FilterService]
})
export class AppModule { }
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';

import 'zone.js';
enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);

Show or hide filter bar operator in filter bar cell

In the TreeGrid component, you have the ability to modify the filter operator for a column directly within the interface while filtering through the filter bar cell. For instance, the default operator for filtering string-type columns in the filter bar is “startswith”. Now, you can customize the default operator for a specific column using the filter operator feature.

To achieve this functionality, you can enable the showFilterBarOperator property within the filterSettings of the grid object using the tree grid instance in the load event of the tree grid.

The following example demonstrates how to show or hide the filter bar operator in the filter bar cell of the tree grid by using the showFilterBarOperator property.

import { Component, OnInit ,ViewChild} from '@angular/core';
import { sampleData } from './datasource';
import { FilterBarMode, FilterSettingsModel } from '@syncfusion/ej2-angular-grids';
import { TreeGridComponent } from '@syncfusion/ej2-angular-treegrid'
@Component({
    selector: 'app-container',
    template: `<div class='container'>
                    <label for="checked"> <b> Show filter bar operator </b> </label>
                    <ejs-switch id="checked" [checked]=true (change)="onChange($event)"></ejs-switch>
                </div>
    
                <ejs-treegrid #treegrid [dataSource]='data' height='275' [treeColumnIndex]='1' [allowPaging]='true' [allowFiltering]='true' childMapping='subtasks' (load)=load($event) >
                    <e-columns>
                        <e-column field='taskID' headerText='Task ID' textAlign='Right' width=90></e-column>
                        <e-column field='taskName' headerText='Task Name' textAlign='Left' width=180></e-column>
                        <e-column field='startDate' headerText='Start Date' textAlign='Right' type='date' format='yMd' width=90></e-column>
                        <e-column field='duration' headerText='Duration' textAlign='Right' width=80></e-column>
                    </e-columns>
                </ejs-treegrid>`
})
export class AppComponent implements OnInit {

    public data?: Object[];
   
    @ViewChild('treegrid')
     public treegrid:TreeGridComponent|undefined;
    ngOnInit(): void {
        this.data = sampleData;
        
    }
    load(args:any): void {
        (this.treegrid as TreeGridComponent).grid.filterSettings = {
            showFilterBarOperator: true,
          };
    }
    onChange(args: any): void {
      (this.treegrid as TreeGridComponent).grid.filterSettings = {
        showFilterBarOperator: args.checked,
      };
  }
}
import { NgModule,ViewChild } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { TreeGridModule } from '@syncfusion/ej2-angular-treegrid';
import { PageService, SortService, FilterService } from '@syncfusion/ej2-angular-treegrid';
import { AppComponent } from './app.component';
import {ButtonModule,SwitchModule} from '@syncfusion/ej2-angular-buttons';
import { DropDownListAllModule } from '@syncfusion/ej2-angular-dropdowns';
import { FormsModule } from '@angular/forms';

/**
 * Module
 */
@NgModule({
    imports: [
        BrowserModule,
        TreeGridModule,SwitchModule,
        ButtonModule,
        DropDownListAllModule,
        FormsModule
    ],
    declarations: [AppComponent],
    bootstrap: [AppComponent],
    providers: [PageService,
                SortService,
                FilterService]
})
export class AppModule { }
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';

import 'zone.js';
enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);

Hide filter bar for template column

By default, the filter bar is set to a disabled mode for template columns in the grid. However, in certain cases, you may want to hide the filter bar for a template column to provide a customized filtering experience.

To hide the filter bar for a template column, you can use the filterTemplate property of the column and remove the html content of the filter bar. This property allows you to define a custom template for the filter bar of a column.

Here’s an example that demonstrates how to hide the filter bar for a template column in the tree grid:

import { Component, OnInit ,ViewChild} from '@angular/core';
import { sampleData } from './datasource';
import { FilterBarMode, FilterSettingsModel } from '@syncfusion/ej2-angular-grids';
import { Column, TreeGridComponent } from '@syncfusion/ej2-angular-treegrid'
import { isNullOrUndefined } from '@syncfusion/ej2-base';
@Component({
    selector: 'app-container',
    template: `<ejs-treegrid #treegrid [dataSource]='data' height='275' [treeColumnIndex]='1' [allowPaging]='true' [allowFiltering]='true' (load)="load()" childMapping='subtasks' >
                    <e-columns>
                        <e-column field='taskID' headerText='Task ID' textAlign='Right' width=90></e-column>
                        <e-column field='taskName' headerText='Task Name' textAlign='Left' width=180></e-column>
                        <e-column headerText="Action" width="150">
                        <ng-template #template let-data>
                            <button ejs-button >Custom action</button>
                        </ng-template>
                    </e-column></e-columns>
                </ejs-treegrid>`
})
export class AppComponent implements OnInit {

    public data?: Object[];
   
    @ViewChild('treegrid')
     public treegrid:TreeGridComponent|undefined;
    ngOnInit(): void {
        this.data = sampleData;
        
    }
    load() {
      //Here find the index of template column
      var column:any=(this.treegrid as TreeGridComponent).columns;
      var templatecol_inx:any=column.findIndex((x:any)=>!isNullOrUndefined(x.template));
      
      // Set filterTemplate to an empty span to hide the filter bar for the template column
      ((this.treegrid as TreeGridComponent).columns[templatecol_inx] as Column).filterTemplate = '<span></span>';
    }
    
}
import { NgModule,ViewChild } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { TreeGridModule } from '@syncfusion/ej2-angular-treegrid';
import { PageService, SortService, FilterService } from '@syncfusion/ej2-angular-treegrid';
import { AppComponent } from './app.component';
import { FormsModule } from '@angular/forms';

/**
 * Module
 */
@NgModule({
    imports: [
        BrowserModule,
        TreeGridModule,
        FormsModule
    ],
    declarations: [AppComponent],
    bootstrap: [AppComponent],
    providers: [PageService,
                SortService,
                FilterService]
})
export class AppModule { }
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';

import 'zone.js';
enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);

Filter bar template with custom component

Normally, text box is the default element rendered in the filter bar cell. You can customize the components displayed in the filter bar cell using the filterBarTemplate feature. This flexibility allows you to use various components, such as datepicker, numerictextbox, combobox, and multiselect, within the filter bar based on your specific requirements.

You can check this video to learn about how to use custom component in filter bar in Angular Tree Grid.

To utilize this feature, you can define a custom template for the filter bar by setting the filterBarTemplate property of a column in your Angular application.

The following example demonstrates how to show a custom component in the filter bar cell of the tree grid by using the filterBarTemplate property.

import { Component, OnInit, ViewChild } from '@angular/core';
import { sampleGridData } from './datasource';
import {IFilterUI,parentsUntil } from '@syncfusion/ej2-angular-grids';
import { TreeGridComponent } from '@syncfusion/ej2-angular-treegrid';
import {
  ComboBox,
  DropDownList,
  MultiSelect,
} from '@syncfusion/ej2-angular-dropdowns';
import { DataManager, DataUtil, Predicate, Query } from '@syncfusion/ej2-data';
import { DatePicker } from '@syncfusion/ej2-angular-calendars';
import { NumericTextBox } from '@syncfusion/ej2-angular-inputs';


@Component({
    selector: 'app-container',
    template: `<ejs-treegrid #treegrid [dataSource]='data' height='275' [treeColumnIndex]='1'  [allowFiltering]='true' idMapping='taskID' parentIdMapping= "parentID" >
                    <e-columns>
                        <e-column field="taskID" headerText="Task ID" width="120" textAlign="Right" isPrimaryKey="true"></e-column>
                        <e-column field="taskName" headerText="Task Name" width="120" [filterBarTemplate]="templateOptionsDropDown"></e-column>
                        <e-column field="duration" headerText="Duration" width="100" format="C2" [filterBarTemplate]="templateOptionsNumericTextBox"></e-column>
                        <e-column field="startDate" headerText="Start Date" width="120" format="yMd" type="date" [filterBarTemplate]="templateOptionsDatePicker"></e-column>
                        <e-column field="description" headerText="Task Description" width="120" [filterBarTemplate]="templateOptionsComboBox"></e-column>
                        <e-column field="category" headerText="Category" width="120" [filterBarTemplate]="templateOptionsMultiSelect"></e-column>
                    </e-columns>
                </ejs-treegrid>`
})
export class AppComponent implements OnInit {
    @ViewChild('treegrid') 
    public treegrid?: TreeGridComponent;

    public data?: Object[];

    public templateOptionsDropDown?: IFilterUI;
    public templateOptionsNumericTextBox?: IFilterUI;
    public templateOptionsDatePicker?: IFilterUI;
    public templateOptionsComboBox?: IFilterUI;
    public templateOptionsMultiSelect?: IFilterUI;
    public categoryDistinctData?: object[];
    public descriptionDistinctData?: object[];
    
    public dropdown?: HTMLElement;
    public numElement?: HTMLInputElement;
    public dateElement?: HTMLInputElement;
    public comboelement?: HTMLElement;
    public multiselectelement?: HTMLElement;
     public handleFilterChange(args: { element: Element; value: string }) {
        let targetElement = parentsUntil(args.element, 'e-filtertext');
        let columnName: string = targetElement.id.replace('_filterBarcell', '');
        if (args.value) {
            (this.treegrid as TreeGridComponent).filterByColumn(columnName, 'equal', args.value);
        } else {
            (this.treegrid as TreeGridComponent).removeFilteredColsByField(columnName);
        }
    } public multiselectFunction(args: { value: string }) {
        var selectedValues = args.value;
        if (selectedValues.length === 0) {
            var OrginalData = new DataManager(this.data).executeLocal(new Query());
            (this.treegrid as TreeGridComponent).dataSource = OrginalData;
        } else {
            var predicate: Predicate | null = null;
            for (let x = 0; x < selectedValues.length; x++) {
                if (predicate === null) {
                    predicate = new Predicate('category', 'equal', selectedValues[x]);
                } else {
                    predicate = predicate.or('category', 'equal', selectedValues[x]);
                }
            }
            var filteredData = new DataManager(this.data).executeLocal(new Query().where(predicate as Predicate));
            (this.treegrid as TreeGridComponent).dataSource = filteredData;
        }
    }
    public dropdownFunction(args: { value: string; item: { parentElement: { id: string } } }
    ) {
        if (args.value !== 'All') {
            (this.treegrid as TreeGridComponent).filterByColumn(args.item.parentElement.id.replace('_options', ''), 'equal', args.value);
        } else {
            (this.treegrid as TreeGridComponent).removeFilteredColsByField(args.item.parentElement.id.replace('_options', ''));
        }
    }

    public ngOnInit(): void {
        this.data = sampleGridData;
        
        this.descriptionDistinctData = DataUtil.distinct(this.data, 'description', true);
        this.categoryDistinctData = DataUtil.distinct(this.data, 'category', true);

        this.templateOptionsDropDown = {
            create: () => {
                this.dropdown = document.createElement('select');
                this.dropdown.id = 'taskName';

                var option = document.createElement('option');
                option.value = 'All';
                option.innerText = 'All';
                this.dropdown.appendChild(option);

                (this.data as Object[]).forEach((item: object) => {
                    const option = document.createElement('option');
                    option.value = (item as ItemType).taskName;
                    option.innerText = (item as ItemType).taskName;
                    (this.dropdown as HTMLElement).appendChild(option);
                });
                return this.dropdown;
            },
            write: () => {
                const dropdownlist = new DropDownList({
                    change: this.dropdownFunction.bind(this),
                });
                dropdownlist.appendTo(this.dropdown);
            },
        };
        this.templateOptionsNumericTextBox = {
            create: () => {
                this.numElement = document.createElement('input');
                return this.numElement;
            },
            write: () => {
                const numericTextBox = new NumericTextBox({
                    format: '00.00',
                    value: 10,
                });
                numericTextBox.appendTo(this.numElement);
            },
        };
        this.templateOptionsDatePicker = {
            create: () => {
                this.dateElement = document.createElement('input');
                return this.dateElement;
            },
            write: (args: { column: { field: string | number | Date } }) => {
                const datePickerObj = new DatePicker({
                    value: new Date(args.column.field),
                    change: this.handleFilterChange.bind(this),
                });
                datePickerObj.appendTo(this.dateElement);
            },
        };
        this.templateOptionsComboBox = {
            create: () => {
                this.comboelement = document.createElement('input');
                this.comboelement.id = 'description';
                return this.comboelement;
            },
            write: (args: { value: string }) => {
                const comboBox = new ComboBox({
                    value: args.value,
                    placeholder: 'Select a city',
                    change: this.handleFilterChange.bind(this),
                    dataSource: (this.descriptionDistinctData as object[]).map(
                        (item: object) => (item as ItemType).description
                    ),
                });
                comboBox.appendTo(this.comboelement);
            },
        };
        this.templateOptionsMultiSelect = {
            create: () => {
                this.multiselectelement = document.createElement('input');
                this.multiselectelement.id = 'category';
                return this.multiselectelement;
            },
            write: (args: { value: string[] | number[] | boolean[] | undefined }) => {
                const multiselect = new MultiSelect({
                    value: args.value,
                    placeholder: 'Select a country',
                    change: this.multiselectFunction.bind(this),
                    dataSource: (this.categoryDistinctData as object[]).map(
                        (item: object) => (item as ItemType).category

                    ),
                });
                multiselect.appendTo(this.multiselectelement);
            },
        };
    }
}

interface ItemType {
    taskName: string,
    description: string,
    category: string
}
import { NgModule,ViewChild } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { TreeGridModule } from '@syncfusion/ej2-angular-treegrid';
import { PageService, SortService, FilterService } from '@syncfusion/ej2-angular-treegrid';
import { AppComponent } from './app.component';
import { FormsModule } from '@angular/forms';
import { MultiSelectModule, CheckBoxSelectionService,DropDownListAllModule } from '@syncfusion/ej2-angular-dropdowns';
import { CheckBoxModule,ButtonModule } from '@syncfusion/ej2-angular-buttons';
import { NumericTextBoxModule } from '@syncfusion/ej2-angular-inputs';
/**
 * Module
 */
@NgModule({
    imports: [
        BrowserModule,
        TreeGridModule,
        FormsModule,MultiSelectModule,
        DropDownListAllModule,
        CheckBoxModule,ButtonModule,
        NumericTextBoxModule
    ],
    declarations: [AppComponent],
    bootstrap: [AppComponent],
    providers: [PageService,
                SortService, CheckBoxSelectionService,
                FilterService]
})
export class AppModule { }
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';

import 'zone.js';
enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);