Footnotes and Endnotes in Angular DOCX Editor

27 Aug 20263 minutes to read

Angular DOCX Editor (Document Editor) Container component provides support for inserting footnotes and endnotes through the built-in toolbar. Refer to the following screenshot.

Insert footnote endnote

Footnotes and endnotes are both ways of adding extra bits of information to your writing outside of the main text. You can use footnotes and endnotes to add side comments to your work or to cite other publications like books, articles, or websites.

Insert footnotes

DOCX Editor exposes an API to insert footnotes at the cursor position programmatically, or they can be inserted at the end of selected text.

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ButtonModule } from '@syncfusion/ej2-angular-buttons';
import { DocumentEditorAllModule } from '@syncfusion/ej2-angular-documenteditor';

import { Component, ViewEncapsulation, ViewChild } from '@angular/core';
import {
  DocumentEditorComponent,
  EditorService,
} from '@syncfusion/ej2-angular-documenteditor';

@Component({
  imports: [ButtonModule, DocumentEditorAllModule],

  standalone: true,
  selector: 'app-container',
  //specifies the template string for the DocumentEditorContainer component
  template: `<div style="width:100%;"><button ejs-button (click)="insertFootnote()" >Insert Footnote</button>
      <ejs-documenteditor #document_editor id="container" height="330px" style="display:block" [enableEditor]=true>
    </ejs-documenteditor>
      </div>`,
  encapsulation: ViewEncapsulation.None,
  providers: [EditorService],
})
export class AppComponent {
  @ViewChild('document_editor')
  public documentEditor?: DocumentEditorComponent;

  public insertFootnote(): void {
    //Insert foot note.
    this.documentEditor?.editor.insertFootnote();
  }
}

The Web API hosted link https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/ utilized in the DOCX Editor’s serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the GitHub Web Service example or Docker image for hosting your own web service and use for the serviceUrl property.

Insert endnotes

DOCX Editor exposes an API to insert endnotes at the cursor position programmatically, or they can be inserted at the end of selected text.

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ButtonModule } from '@syncfusion/ej2-angular-buttons';
import { DocumentEditorAllModule } from '@syncfusion/ej2-angular-documenteditor';

import { Component, ViewEncapsulation, ViewChild } from '@angular/core';
import {
  DocumentEditorComponent,
  EditorService,
} from '@syncfusion/ej2-angular-documenteditor';

@Component({
  imports: [ButtonModule, DocumentEditorAllModule],

  standalone: true,
  selector: 'app-container',
  //specifies the template string for the DocumentEditorContainer component
  template: `<div style="width:100%;"><button ejs-button (click)="insertEndnote()" >Insert Endnote</button>
      <ejs-documenteditor #document_editor id="container" height="330px" style="display:block" [enableEditor]=true>
    </ejs-documenteditor>
      </div>`,
  encapsulation: ViewEncapsulation.None,
  providers: [EditorService],
})
export class AppComponent {
  @ViewChild('document_editor')
  public documentEditor?: DocumentEditorComponent;

  public insertEndnote(): void {
    //Insert end note.
    this.documentEditor?.editor.insertEndnote();
  }
}

The Web API hosted link https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/ utilized in the DOCX Editor’s serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the GitHub Web Service example or Docker image for hosting your own web service and use for the serviceUrl property.

Update or edit footnotes and endnotes

You can update or edit the footnotes and endnotes using the built-in context menu shown by right-clicking the footnote or endnote. The Footnote/Endnote dialog box pops up, and you can customize the number format and the starting value. Refer to the following screenshot.

Update or edit footnotes and endnotes

Online Demo

Explore how to add and manage notes in Word documents using the Angular DOCX Editor in this live demo.