|
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> |
2 | 6 |
|
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 |
4 | 8 |
|
5 | | -## Development server |
| 9 | +[](https://badge.fury.io/js/%40angular-material-extensions%2Falgolia) |
| 10 | +[](https://angular-material-extensions.github.io/algolia) |
| 11 | +[](https://gitter.im/angular-material-extensions/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
| 12 | +[](https://coveralls.io/github/angular-material-extensions/algolia?branch=master) |
| 13 | +[](https://travis-ci.org/angular-material-extensions/algolia) |
| 14 | +[](https://circleci.com/gh/angular-material-extensions/algolia) |
| 15 | +[](https://david-dm.org/angular-material-extensions/algolia) |
| 16 | +[](https://david-dm.org/angular-material-extensions/algolia#info=devDependencies) |
| 17 | +[](https://greenkeeper.io/) |
| 18 | +[](https://github.com/angular-material-extensions/algolia/blob/master/LICENSE) |
6 | 19 |
|
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. |
8 | 20 |
|
9 | | -## Code scaffolding |
10 | 21 |
|
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) |
12 | 25 |
|
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: |
14 | 28 |
|
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) |
16 | 42 |
|
17 | | -## Running unit tests |
| 43 | +<a name="demo"/> |
18 | 44 |
|
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) |
20 | 46 |
|
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) |
22 | 48 |
|
23 | | -Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). |
| 49 | +<a name="dependencies"/> |
24 | 50 |
|
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) |
26 | 232 |
|
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). |
|
0 commit comments