Angular
visio-angular-viewer gives you the shared <visio-viewer> as a native Angular integration.
npm install visio-angular-viewer @angular/coreimport { Component, Input } from '@angular/core';
import { VisioViewerComponent } from 'visio-angular-viewer';
import type { VisioDocument } from 'visio-angular-viewer';
@Component({
selector: 'app-diagram',
imports: [VisioViewerComponent],
template: '<visio-viewer-host [document]="diagram" (documentError)="onError($event)" />',
styles: ['visio-viewer-host { display: block; height: 600px }'],
})
export class Diagram {
@Input() diagram: VisioDocument | null = null;
onError(error: Error) {
console.error(error);
}
}Outputs are documentLoad, documentChange, documentError, pageChange, zoomChange, shapeSelect, selectionChange, ribbonAddIn, collaborationChange and fileCommand. fileCommand only reports a File command: to cancel it, return false from the events['file-command'] callback. The complete events callback map is also accepted as an input.
The properties (document, pageIndex, zoom, showToolbar, canEdit, readOnly, locale, ribbonAddIns, collaboration, storage, fileProviders, customization, events) and the handle are identical in every framework: see the binding contract and the viewer API. To compose your own UI from the viewer's parts instead, see the building blocks; to share a drawing, see collaboration. Try the Angular demo.