su-get-html
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

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

  1. host - pass the url to the app | type: string
  2. 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';
}

Package Sidebar

Install

npm i su-get-html

Weekly Downloads

1

Version

0.0.9

License

none

Unpacked Size

91.2 kB

Total Files

26

Last publish

Collaborators

  • html-package