Get unlimited public & private packages + package-based permissions with npm Pro.Get started »


2.8.3 • Public • Published

Angular 4+ directive for Flexmonster Pivot component

Flexmonster Pivot table component

This repository holds the TypeScript source code for using Flexmonster Pivot in Angular applications.

Getting Started

You have the following options to start:


Node.js and npm are essential to Angular development.

Get it now if it's not already installed on your machine.

Verify that you are running at least node v4.x.x and npm 3.x.x by running node -v and npm -v in a terminal/console window. Older versions produce errors.

We recommend nvm for managing multiple versions of node and npm.

Then install the Angular CLI globally:

npm install -g @angular/cli

Integrate Flexmonster into existing/new application

If you don’t have Angular CLI app, you can create it by running in the console:


Add Flexmonster Angular module by running in the console:

npm i ng-flexmonster --save

Add Flexmonster CSS and JS references to angular.json:

"styles": [ 
"scripts": [ 

Include FlexmonsterPivotModule into app.module.ts. app.module.ts can be found inside PROJECT-NAME/src/app folder.

import { FlexmonsterPivotModule } from 'ng-flexmonster';
  imports: [FlexmonsterPivotModule],

Insert fm-pivot directive where you need the pivot table, for example app.component.html.


Run your application from the console:

ng serve

To see the result open your browser on http://localhost:4200/.

Run simple Angular and Flexmonster sample from GitHub

Download .zip archive with the sample or clone it from GitHub within the following command:

git clone my-proj
cd my-proj

Install the npm packages described in the package.json:

npm install

Run your application:

ng serve

To see the result open your browser on http://localhost:4200/.


fm-pivot directive and its attributes

fm-pivot directive embeds the component into the HTML page. Every attribute for fm-pivot directive is set either as a string value or as an Angular variable. Here is the list of available attributes:

  • componentFolder – URL of the component’s folder which contains all necessary files. Also, it is used as a base URL for report files, localization files, styles and images. The default value for componentFolder is flexmonster/.
  • width – width of the component on the page (pixels or percent). The default value for width is 100%.
  • height – height of the component on the page (pixels or percent). The default value for height is 500.
  • report – property to set a report. It can be inline Report Object or URL to report JSON.
  • toolbar – parameter to embed the toolbar or not. Default value is false – without the toolbar.
  • customizeCell – function that allows customizing of separate cells. Have a look at customizeCell definition and examples.
  • licenseKey – the license key.

Here is how all these attributes should be specified:

<fm-pivot [componentFolder]="''"
    Flexmonster will appear here

Using API calls and events

Check out how setReport() API method is called when handling onReportComplete event in app.component.ts:

onReportComplete(): void {"reportcomplete");
        dataSource: {
            filename: ""

Also, you need to specify that onReportComplete handles reportcomplete event in fm-pivot directive:


Here is the list of all available API methods and events.

Angular Material tabs example

This sample on GitHub shows how to add Flexmonster to Angular Material tabs.


Here is Flexmonster licensing page. We have free 30 day trial!

Flexmonster Angular directive is released as a MIT-licensed (free and open-source) add-on to Flexmonster Pivot.

Support & feedback

Please share your feedback or ask questions via Flexmonster Forum.


npm i ng-flexmonster

DownloadsWeekly Downloads






Unpacked Size

222 kB

Total Files


Last publish


  • avatar