@sourceloop/search-element 6.1.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -25
- package/package.json +4 -4
- package/search-element.js +3 -3
- package/styles.css +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ An Angular module that exports a component that can enable users to search over
|
|
|
4
4
|
|
|
5
5
|
### Deprecation Notice
|
|
6
6
|
|
|
7
|
-
Search-client now supports
|
|
7
|
+
Search-client now supports Angular v19, we will provide support for the older version that is based on Angular v17 till 31st March 2026 .
|
|
8
8
|
|
|
9
9
|
## Angular Module
|
|
10
10
|
|
|
@@ -16,33 +16,21 @@ npm i @sourceloop/search-client
|
|
|
16
16
|
|
|
17
17
|
### Usage
|
|
18
18
|
|
|
19
|
-
Create a new Application using Angular CLI and import the
|
|
20
|
-
Your module will then look something like this
|
|
19
|
+
Create a new Application using Angular CLI and import the `SearchComponent` in your application.SearchComponent is now a standalone component, so no NgModule is required.Also create a new service that implements the ISearchService interface exported by the search library. This service will be used by the exported component to make API calls whenever needed. You will have to update the providers section of your module with { provide: SEARCH_SERVICE_TOKEN, useExisting: Your_Service_Name }
|
|
21
20
|
|
|
22
21
|
```ts
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
import {SearchService} from './search.service';
|
|
34
|
-
@NgModule({
|
|
35
|
-
declarations: [AppComponent, XComponent],
|
|
36
|
-
imports: [
|
|
37
|
-
BrowserModule,
|
|
38
|
-
SearchLibModule, //import SearchLibModule
|
|
39
|
-
HttpClientModule,
|
|
40
|
-
ReactiveFormsModule,
|
|
41
|
-
],
|
|
42
|
-
providers: [{provide: SEARCH_SERVICE_TOKEN, useClass: SearchService}], //Add your service here
|
|
43
|
-
bootstrap: [AppComponent],
|
|
22
|
+
import { Component } from '@angular/core';
|
|
23
|
+
import { SearchComponent, SEARCH_SERVICE_TOKEN } from '@sourceloop/search-client';
|
|
24
|
+
import { SearchService } from './search.service';
|
|
25
|
+
|
|
26
|
+
@Component({
|
|
27
|
+
selector: 'app-root',
|
|
28
|
+
standalone: true,
|
|
29
|
+
imports: [SearchComponent],
|
|
30
|
+
templateUrl: './app.component.html',
|
|
31
|
+
providers: [{ provide: SEARCH_SERVICE_TOKEN, useClass: SearchService }],
|
|
44
32
|
})
|
|
45
|
-
export class
|
|
33
|
+
export class AppComponent {}
|
|
46
34
|
```
|
|
47
35
|
|
|
48
36
|
### Search Service
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sourceloop/search-element",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "A global search element for search microservice.",
|
|
3
|
+
"version": "8.0.0",
|
|
4
|
+
"description": "A global search element for search microservice. ",
|
|
5
5
|
"main": "./search-element.js",
|
|
6
6
|
"private": false,
|
|
7
7
|
"scripts": {
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
},
|
|
20
20
|
"author": "Sourcefuse",
|
|
21
21
|
"license": "MIT",
|
|
22
|
-
"hash": "
|
|
23
|
-
"gitHead": "
|
|
22
|
+
"hash": "b5fdb11c9f1575d7e222aba51e2350f9bab4f913404a2c9a9216650512a65690",
|
|
23
|
+
"gitHead": "a19010968b6e90c0a28f47c03826f276c918f162"
|
|
24
24
|
}
|