su-search
v0.1.4
Published
Angular library for importing and generating a search client created inside a SearchUnify instance. This library accepts SearchUnify's instance name and uid to generate the search client in an Angular component. Published by the SearchUnify team.
Downloads
30
Maintainers
Readme
SearchUnify search client generator for Angular apps
Angular library for importing and generating a search client created inside a SearchUnify instance. This library accepts SearchUnify's instance name and uid to generate the search client in an Angular component. Published by the SearchUnify team.
Installation
Run npm install su-search
to install the library.
Sample implementation - Search Client
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { SuSearchModule } from 'su-search'; //<-- Import the module
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
SuSearchModule //<-- Add the module in imports
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app.component.html
- Add the directive where search client is expected in your application.
Example:
<su-search instance="customer-name.searchunify.com" uid="6de95369-xxxxxxxx-xxxxxxxx-xxxxxxxx"></su-search>
Sample implementation - Search Box and autocomplete
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { SuSearchModule } from 'su-search'; //<-- Import the module
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
SearchBoxModule //<-- Add the module in imports
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app.component.html
- Add the directive where search client is expected in your application.
Example:
<search-box instance="customer-name.searchunify.com" uid="6de95369-xxxxxxxx-xxxxxxxx-xxxxxxxx"></search-box>
Required attributes
- instance - Host name of the customer SearchUnify instance | type: string
- uid - uid of the search client | type: string