Skip to content

Commit e1d647f

Browse files
committed
docs(project): updated the README.md file
1 parent ed4c567 commit e1d647f

File tree

6 files changed

+229
-20
lines changed

6 files changed

+229
-20
lines changed

README.md

Lines changed: 219 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,232 @@
1-
# Algolia
1+
<p align="center">
2+
<img alt="angular-material-extensions's logo"
3+
height="256px" width="256px" style="text-align: center;"
4+
src="https://cdn.rawgit.com/angular-material-extensions/algolia/master/assets/angular-material-extensions-logo.svg">
5+
</p>
26

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.3.
7+
# @angular-material-extensions/algolia - Angular Library that enhances algolia instant search library - Material UI components and general services and directives
48

5-
## Development server
9+
[![npm version](https://badge.fury.io/js/%40angular-material-extensions%2Falgolia.svg)](https://badge.fury.io/js/%40angular-material-extensions%2Falgolia)
10+
[![npm demo](https://img.shields.io/badge/demo-online-ed1c46.svg)](https://angular-material-extensions.github.io/algolia)
11+
[![Join the chat at https://gitter.im/angular-material-extensions/Lobby](https://badges.gitter.im/angular-material-extensions/Lobby.svg)](https://gitter.im/angular-material-extensions/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
12+
[![Coverage Status](https://coveralls.io/repos/github/angular-material-extensions/algolia/badge.svg?branch=master)](https://coveralls.io/github/angular-material-extensions/algolia?branch=master)
13+
[![Build Status](https://travis-ci.org/angular-material-extensions/algolia.svg?branch=master)](https://travis-ci.org/angular-material-extensions/algolia)
14+
[![CircleCI branch](https://img.shields.io/circleci/project/github/angular-material-extensions/algolia/master.svg?label=circleci)](https://circleci.com/gh/angular-material-extensions/algolia)
15+
[![dependency Status](https://david-dm.org/angular-material-extensions/algolia/status.svg)](https://david-dm.org/angular-material-extensions/algolia)
16+
[![devDependency Status](https://david-dm.org/angular-material-extensions/algolia/dev-status.svg?branch=master)](https://david-dm.org/angular-material-extensions/algolia#info=devDependencies)
17+
[![Greenkeeper Badge](https://badges.greenkeeper.io/angular-material-extensions/algolia.svg)](https://greenkeeper.io/)
18+
[![license](https://img.shields.io/github/license/angular-material-extensions/algolia.svg?style=flat-square)](https://github.com/angular-material-extensions/algolia/blob/master/LICENSE)
619

7-
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
820

9-
## Code scaffolding
1021

11-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
22+
## Built by and for developers :heart:
23+
Do you have any question or suggestion ? Please do not hesitate to contact us!
24+
Alternatively, provide a PR | open an appropriate issue [here](https://github.com/angular-material-extensions/google-maps-auto/issues)
1225

13-
## Build
26+
If did you like this project, support [angular-material-extensions](https://github.com/angular-material-extensions)
27+
by starring :star: and sharing it :loudspeaker:
1428

15-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
29+
## Table of Contents
30+
- [Demo](#demo)
31+
- [Dependencies](#dependencies)
32+
- [Peer Dependencies](#peerDependencies)
33+
- [Additional Requirements - material (Include a theme)](#additional-requirements-material-theme)
34+
- [Installation](#installation)
35+
- [Usage](#usage)
36+
- [Documentation](#documentation)
37+
- [Run Demo App Locally](#run-demo-app-locally)
38+
- [Development](#development)
39+
- [Other Angular Libraries](#other-angular-libraries)
40+
- [Support](#support)
41+
- [License](#license)
1642

17-
## Running unit tests
43+
<a name="demo"/>
1844

19-
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
45+
## [Demo](https://angular-material-extensions.github.io/algolia)
2046

21-
## Running end-to-end tests
47+
View all the directives and components in action at [https://angular-material-extensions.github.io/algolia](https://angular-material-extensions.github.io/algolia)
2248

23-
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
49+
<a name="dependencies"/>
2450

25-
## Further help
51+
## Dependencies
52+
* [Angular](https://angular.io) (*requires* Angular 2 or higher | we are using already V9 ;)
53+
54+
for the directive as standalone you just need to install the following packages
55+
56+
- "algoliasearch": "^3.35.1",
57+
- "angular-instantsearch": "^3.0.0-beta.5",
58+
- "instantsearch.js": "^4.7.0",
59+
- "@types/algoliasearch": "^3.34.10"
60+
61+
```bash
62+
npm install algoliasearch@3 angular-instantsearch@beta instantsearch.js@3
63+
64+
npm install --save-dev @types/algoliasearch
65+
```
66+
67+
68+
<a name="installation"/>
69+
70+
## [Installation](https://angular-material-extensions.github.io/algolia/getting-started)
71+
72+
## 1. Install via *ng add*. (Recommended)
73+
74+
If Angular Material Design is not setup, just run `ng add @angular/material` [learn more](https://material.angular.io/guide/getting-started)
75+
76+
Now add the library via the `angular schematics` and everything will be setup for you
77+
```shell
78+
ng add @angular-material-extensions/algolia
79+
```
80+
81+
82+
## 2. Install via *npm*. (Alternative)
83+
84+
Now install `@angular-material-extensions/algolia` via:
85+
```shell
86+
npm install --save @angular-material-extensions/algolia
87+
```
88+
89+
<a name="peerDependencies"/>
90+
91+
### Requirements (peer dependencies):
92+
93+
for the ui input component, please consider to install the following packages
94+
- [angular animations v9.x](https://www.npmjs.com/package/@angular/animations)
95+
- [angular material v9.x](https://www.npmjs.com/package/@angular/material)
96+
- [angular cdk v9.x](https://www.npmjs.com/package/@angular/cdk)
97+
98+
```bash
99+
npm i @angular/cdk @angular/material @angular/animations
100+
```
101+
102+
<a name="additional-requirements-material-theme"/>
103+
104+
### Additional requirements Theme (Material Design)
105+
- [angular material theme](https://material.angular.io/guide/getting-started#step-4-include-a-theme)
106+
107+
----
108+
109+
##### SystemJS
110+
>**Note**:If you are using `SystemJS`, you should adjust your configuration to point to the UMD bundle.
111+
In your systemjs config file, `map` needs to tell the System loader where to look for `@angular-material-extensions/algolia`:
112+
```js
113+
{
114+
'@angular-material-extensions/algolia';: 'node_modules/@angular-material-extensions/algolia/bundles/algolia.umd.js',
115+
}
116+
```
117+
---
118+
119+
Once installed you need to import the main module:
120+
```js
121+
import { MatAlgoliaModule } from '@angular-material-extensions/algolia';
122+
```
123+
The only remaining part is to list the imported module in your application module. The exact method will be slightly
124+
different for the root (top-level) module for which you should end up with the code similar to (notice ` MatAlgoliaModule.forRoot()`):
125+
```js
126+
import { MatAlgoliaModule } from '@angular-material-extensions/algolia';
127+
128+
@NgModule({
129+
declarations: [AppComponent, ...],
130+
imports: [
131+
// important !!!
132+
133+
MatAlgoliaModule, ...],
134+
bootstrap: [AppComponent]
135+
})
136+
export class AppModule {
137+
}
138+
```
139+
140+
141+
<a name="usage"/>
142+
143+
## Usage
144+
145+
### Components
146+
147+
148+
149+
### Directives
150+
151+
add `matAlgoliaRefresh` to a button component in order to trigger a refresh mechanism via algolia api automatically
152+
153+
```html
154+
<button mat-icon-button matAlgoliaRefresh matTooltip="Aktualisieren">
155+
<mat-icon>refresh</mat-icon>
156+
</button>
157+
```
158+
159+
160+
<a name="api"/>
161+
162+
### API - for more info please visit the official documentation [Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/places-autocomplete?hl=en)
163+
164+
### `mat-algolia-menu-select`
165+
| option | bind | type | default | description |
166+
|:-------------------|:--------:|:------:|:------------:|:-------------------------------------------------------------------------------------------------|
167+
| attribute | `Input()` | string ; | - | key to filter
168+
169+
170+
171+
172+
173+
174+
<a name="documentation"/>
175+
176+
## [Documentation](https://angular-material-extensions.github.io/algolia/doc/index.html)
177+
178+
Please checkout the full documentation [here](https://angular-material-extensions.github.io//algolia/doc/index.html)
179+
180+
181+
<a name="run-demo-app-locally"/>
182+
183+
## Run Demo App Locally
184+
185+
- [clone this repo](https://github.com/angular-material-extensions/algolia.git) by running
186+
```bash
187+
$ git clone https://github.com/angular-material-extensions/algolia.git
188+
```
189+
190+
- build the library
191+
192+
- serve the demo app
193+
194+
195+
196+
<a name="development"/>
197+
198+
## Development
199+
200+
1. clone this [repo](https://github.com/angular-material-extensions/algolia.git)
201+
2. Install the dependencies by running `npm i`
202+
3. go to lib directory under `projects/angular-material-extensions/algolia`
203+
4. build the library `npm run build`
204+
205+
206+
<a name="other-angular-libraries"/>
207+
208+
## Other Angular Libraries
209+
- [ngx-auth-firebaseui](https://github.com/AnthonyNahas/ngx-auth-firebaseui)
210+
- [ngx-linkifyjs](https://github.com/AnthonyNahas/ngx-linkifyjs)
211+
- [@angular-material-extensions/pages](https://github.com/angular-material-extensions/pages)
212+
- [@angular-material-extensions/link-preview](https://github.com/angular-material-extensions/link-preview)
213+
- [@angular-material-extensions/password-strength](https://github.com/angular-material-extensions/password-strength)
214+
- [@angular-material-extensions/google-maps-autocomplete](https://github.com/angular-material-extensions/google-maps-autocomplete)
215+
- [@angular-material-extensions/select-country](https://github.com/angular-material-extensions/select-country)
216+
- [@angular-material-extensions/fab-menu](https://github.com/angular-material-extensions/fab-menu)
217+
- [@angular-material-extensions/faq](https://github.com/angular-material-extensions/faq)
218+
- [@angular-material-extensions/contacts](https://github.com/angular-material-extensions/contacts)
219+
220+
<a name="support"/>
221+
222+
## Support
223+
+ or open an appropriate [issue](https://github.com/angular-material-extensions/algolia/issues)
224+
+ let us chat on [Gitter](https://gitter.im/angular-material-extensions/Lobby)
225+
226+
Built by and for developers :heart: we will help you :punch:
227+
228+
229+
## License
230+
231+
Copyright (c) 2020 [Anthony Nahas](https://github.com/AnthonyNahas). Licensed under the MIT License (MIT)
26232

27-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
49 KB
Loading
Lines changed: 1 addition & 0 deletions
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"@nguniversal/express-engine": "^9.1.1",
3030
"algoliasearch": "^3.35.1",
3131
"angular-instantsearch": "^3.0.0-beta.5",
32-
"express": "^4.15.2",
3332
"instantsearch.js": "^4.7.0",
33+
"express": "^4.15.2",
3434
"rxjs": "^6.6.0",
3535
"tslib": "^1.13.0",
3636
"zone.js": "^0.10.3"

projects/angular-material-extensions/algolia/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-material-extensions/algolia",
3-
"description": "Angular Library that enhanced algolia instant search library - Material UI component and general services and directives",
3+
"description": "Angular Library that enhances algolia instant search library - Material UI components and general services and directives",
44
"version": "0.0.1",
55
"homepage": "https://angular-material-extensions.github.io/algolia",
66
"author": {

projects/angular-material-extensions/algolia/src/lib/components/mat-algolia-menu-select/mat-algolia-menu-select.component.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Component, forwardRef, Inject, OnInit } from '@angular/core';
2-
import { BaseWidget, NgAisInstantSearch } from 'angular-instantsearch';
3-
import { connectMenu } from 'instantsearch.js/es/connectors';
1+
import {Component, forwardRef, Inject, Input, OnInit} from '@angular/core';
2+
import {BaseWidget, NgAisInstantSearch} from 'angular-instantsearch';
3+
import {connectMenu} from 'instantsearch.js/es/connectors';
44

55
@Component({
66
selector: 'mat-algolia-menu-select',
@@ -9,6 +9,9 @@ import { connectMenu } from 'instantsearch.js/es/connectors';
99
})
1010
export class MatAlgoliaMenuSelectComponent extends BaseWidget implements OnInit {
1111

12+
@Input()
13+
attribute: string;
14+
1215
state: {
1316
items: { label: string; value: string }[];
1417
createURL: () => string;
@@ -26,7 +29,7 @@ export class MatAlgoliaMenuSelectComponent extends BaseWidget implements OnInit
2629
}
2730

2831
public ngOnInit() {
29-
this.createWidget(connectMenu, { attribute: 'categories' });
32+
this.createWidget(connectMenu, {attribute: this.attribute});
3033
super.ngOnInit();
3134
}
3235
}

0 commit comments

Comments
 (0)