← Smart Paste API

Component · v2.6.0

NgbSmartPasteComponent

A review step for mapping pasted text to application-defined fields.

Import

import { NgbSmartPasteComponent } from '@angular-bootstrap/ngbootstrap';

Selector:ngb-smart-paste

Usage notes

  • This is a presentation component. Your application owns provider requests, credentials, cancellation, persistence and error handling. Rendered response text is not executable HTML.

Declaration

Inputs

label

Visible heading or label for the component.

readonly label: i0.InputSignal<string>

emptyText

Text displayed when there are no results.

readonly emptyText: i0.InputSignal<string>

fields

Allowed destination fields. The component does not infer values or call an AI provider.

readonly fields: i0.InputSignal<readonly NgbSmartPasteField[]>

suggestions

Application-provided field/value candidates. Only known fields with string values are shown; the first candidate for each field is used.

readonly suggestions: i0.InputSignal<readonly NgbSmartPasteSuggestion[]>

disabled

Disables user actions. This does not cancel an existing backend request.

readonly disabled: i0.InputSignal<boolean>

busy

Marks a request in progress and prevents another submission. The application controls this state.

readonly busy: i0.InputSignal<boolean>

error

Application-provided error message displayed to the user.

readonly error: i0.InputSignal<string>

source

Pasted source text; supports [(source)] two-way binding.

readonly source: i0.ModelSignal<string>

Outputs

mappingRequest

Emits trimmed source text and a copy of the destination fields. The application performs extraction.

readonly mappingRequest: i0.OutputEmitterRef<NgbSmartPasteRequest>

valuesApply

Emits the selected, reviewed field/value pairs. The application validates and writes them.

readonly valuesApply: i0.OutputEmitterRef<readonly NgbSmartPasteSuggestion[]>

stop

Requests cancellation. The application must abort its backend request and clear busy.

readonly stop: i0.OutputEmitterRef<void>

sourceChange

Emits when source changes through the component. Use [(source)] for two-way binding.

sourceChange: OutputRef<string>

Properties

excluded

readonly excluded: i0.WritableSignal<Set<string>>

edits

readonly edits: i0.WritableSignal<Map<string, string>>

candidates

readonly candidates: i0.Signal<{ field: NgbSmartPasteField; value: string; }[]>

selected

readonly selected: i0.Signal<{ field: string; value: string; }[]>

Methods

request

request(text: string): void

toggle

toggle(key: string): void

edit

edit(key: string, event: Event): void

apply

apply(): void

Referenced types

Source: src/ai/src/smart-paste.component.ts in the installed @angular-bootstrap/ngbootstrap package. Angular compiler metadata and private members are omitted.

This project is not affiliated with ng-bootstrap or ngx-bootstrap. Those projects focus mainly on Bootstrap components for Angular. ngbootstrap focuses on Angular UI for data-heavy apps, especially Data Grid, Angular-native Form Builder, drag and drop workflows, documentation examples, and performance-focused Angular patterns.