su-get-html
v0.0.9
Published
An Angular library for importing and generating a search client created inside an angular instance. This library accepts SearchUnify's instance name and uid to generate the search client inside an Angular component. [Created by the SearchUnify team]
Downloads
7
Maintainers
Readme
SearchUnify search client generator
An Angular library for importing and generating a search client created inside an angular instance. This library accepts SearchUnify's instance name and uid to generate the search client inside an Angular component. [Created by the SearchUnify team]
Installation
Run npm install su-get-html
to install the library.
How to use?
- Include su-get-html module in app.module.ts:
import { SuModule } from 'su-get-html';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
SuModule //<-- add the module in imports
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
- Add the component where search client is expected in your application.
To brief the signatures of the components as below
- host - pass the url to the app | type: string
- uid - this is the uid of the searchclient | type: string
Sample implementation
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 { SuModule } from 'su-get-html';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
SuModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app.component.html
This is a sample page.
<lib-su host="https://sampleUrl.com" uid="6de95369-218e"></lib-su>
app.component.ts
import { Component,Input,Output } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'angular-component-library';
}