├── .editorconfig
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── angular.json
├── demo.gif
├── demo2.gif
├── e2e
├── src
│ ├── app.e2e-spec.ts
│ └── app.po.ts
└── tsconfig.e2e.json
├── package-lock.json
├── package.json
├── projects
└── ng-auto-complete
│ ├── karma.conf.js
│ ├── ng-package.json
│ ├── package.json
│ ├── src
│ ├── lib
│ │ ├── classes
│ │ │ ├── AutocompleteGroup.ts
│ │ │ ├── AutocompleteItem.ts
│ │ │ └── typing.ts
│ │ ├── completer
│ │ │ └── completer.component.ts
│ │ ├── dropdown
│ │ │ └── ng-dropdown.directive.ts
│ │ ├── ng-auto-complete.component.ts
│ │ ├── ng-auto-complete.module.ts
│ │ ├── pipes
│ │ │ ├── highlight.ts
│ │ │ ├── key-value.ts
│ │ │ └── pipes.module.ts
│ │ └── utils
│ │ │ └── utils.ts
│ ├── public_api.ts
│ └── test.ts
│ ├── tsconfig.lib.json
│ ├── tsconfig.spec.json
│ └── tslint.json
├── src
├── app
│ ├── app-routing.module.ts
│ ├── app.component.html
│ ├── app.component.ts
│ ├── app.module.ts
│ ├── ng-holder
│ │ ├── ng-holder.component.html
│ │ └── ng-holder.component.ts
│ ├── ng-view
│ │ ├── ng-view.component.html
│ │ └── ng-view.component.ts
│ └── routes
│ │ ├── route1
│ │ ├── route1.component.html
│ │ └── route1.component.ts
│ │ └── route2
│ │ ├── route2.component.html
│ │ └── route2.component.ts
├── assets
│ └── .gitkeep
├── browserslist
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── favicon.ico
├── index.html
├── karma.conf.js
├── main.ts
├── polyfills.ts
├── styles.css
├── test.ts
├── tsconfig.app.json
├── tsconfig.spec.json
└── tslint.json
├── tsconfig.json
└── tslint.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 4
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 |
8 | # dependencies
9 | /node_modules
10 |
11 | # IDEs and editors
12 | /.idea
13 | .project
14 | .classpath
15 | .c9/
16 | *.launch
17 | .settings/
18 | *.sublime-workspace
19 |
20 | # IDE - VSCode
21 | .vscode/*
22 | !.vscode/settings.json
23 | !.vscode/tasks.json
24 | !.vscode/launch.json
25 | !.vscode/extensions.json
26 |
27 | # misc
28 | /.sass-cache
29 | /connect.lock
30 | /coverage
31 | /libpeerconnection.log
32 | npm-debug.log
33 | testem.log
34 | /typings
35 |
36 | # e2e
37 | /e2e/*.js
38 | /e2e/*.map
39 |
40 | # System Files
41 | .DS_Store
42 | Thumbs.db
43 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | * Using welcoming and inclusive language
12 | * Being respectful of differing viewpoints and experiences
13 | * Gracefully accepting constructive criticism
14 | * Focusing on what is best for the community
15 | * Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | * Trolling, insulting/derogatory comments, and personal or political attacks
21 | * Public or private harassment
22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | * Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at benjamin@codebridge.nl. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | ### Do you like to code?
4 |
5 | - Fork & clone
6 | - npm install
7 | - ng serve
8 | - git checkout -b my-new-feature
9 | - component lives in src/app/ng-autocomplete/*
10 | - Submit a pull request
11 |
12 | ### Do you like organizing?
13 | - Link to duplicate issues, and suggest new issue labels, to keep things organized
14 | - Go through open issues and suggest closing old ones.
15 | - Ask clarifying questions on recently opened issues to move the discussion forward
16 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 sengirab
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NgAutoComplete / Example
2 | Light-weight autocomplete component for Angular.
3 |
4 | [](https://codeclimate.com/github/sengirab/ngAutocomplete)
5 | [](https://badge.fury.io/js/ng-auto-complete)
6 |
7 |
8 | https://github.com/sengirab/ngAutocomplete
9 |
10 | 
11 |
12 | # Installation
13 |
14 | `npm i ng-auto-complete --save`
15 |
16 | # Styling !Important
17 | First thing to note, i've created this package to be as simple as possible. That's why i don't include any styling,
18 | this is so you could style it the way you want it.
19 |
20 | If you like the styling i did for the example .gif shown above, you can copy it from [here.](https://github.com/sengirab/ngAutocomplete/blob/master/src/styles.css)
21 | ### Classes
22 | - .ng-autocomplete-dropdown (.open .is-loading .is-async)
23 | - .ng-autocomplete-inputs
24 | - .ng-autocomplete-input
25 | - .ng-autocomplete-placeholder
26 | - .ng-autocomplete-dropdown-icon (.open)
27 | - .ng-dropdown (.open .is-initial-empty)
28 | - .dropdown-item (.active)
29 |
30 |
31 | # Responses !Important
32 | #### Response when selected
33 | ```json
34 | "{group: AutocompleteGroup, item: AutocompleteItem}"
35 | ```
36 | #### Response when cleared
37 | ```json
38 | "{group: AutocompleteGroup, item: null}"
39 | ```
40 | Note that when calling completer.ResetInput('completer'), this will clear the input. This means that the
41 | completer will emit `{group: AutocompleteGroup, item: null}`. If your listening to this within your component
42 | keep in mind that each clear the item will be null
43 |
44 | The input will also emit "null" when the input reaches a length of `<= 0`.
45 |
46 |
47 | # Usage
48 |
49 | #### app.module.ts
50 | ```typescript
51 | import {BrowserModule} from "@angular/platform-browser";
52 | import {NgModule} from "@angular/core";
53 | import {FormsModule} from "@angular/forms";
54 | import {HttpModule} from "@angular/http";
55 |
56 | import {AppComponent} from "./app.component";
57 | import {NgAutoCompleteModule} from "ng-auto-complete";
58 |
59 | @NgModule({
60 | declarations: [
61 | AppComponent
62 | ],
63 | imports: [
64 | BrowserModule,
65 | FormsModule,
66 | HttpModule,
67 | NgAutoCompleteModule
68 | ],
69 | providers: [],
70 | bootstrap: [AppComponent]
71 | })
72 | export class AppModule {
73 | }
74 | ```
75 |
76 | #### app.component.ts
77 | ```typescript
78 | import {Component, ViewChild} from "@angular/core";
79 | import {CreateNewAutocompleteGroup, SelectedAutocompleteItem, NgAutoCompleteComponent} from "ng-auto-complete";
80 |
81 | @Component({
82 | selector: 'app-root',
83 | templateUrl: './app.component.html',
84 | })
85 | export class AppComponent {
86 | @ViewChild(NgAutoCompleteComponent) public completer: NgAutoCompleteComponent;
87 |
88 | public group = [
89 | CreateNewAutocompleteGroup(
90 | 'Search / choose in / from list',
91 | 'completer',
92 | [
93 | {title: 'Option 1', id: '1'},
94 | {title: 'Option 2', id: '2'},
95 | {title: 'Option 3', id: '3'},
96 | {title: 'Option 4', id: '4'},
97 | {title: 'Option 5', id: '5'},
98 | ],
99 | {titleKey: 'title', childrenKey: null}
100 | ),
101 | ];
102 |
103 | constructor() {
104 |
105 | }
106 |
107 | /**
108 | *
109 | * @param item
110 | * @constructor
111 | */
112 | Selected(item: SelectedAutocompleteItem) {
113 | console.log(item);
114 | }
115 | }
116 |
117 | ```
118 |
119 | #### app.component.html
120 | ```html
121 |
122 | ```
123 |
124 | # Remove selected values
125 | ```typescript
126 | public selected: any[] = [];
127 |
128 | Selected(item: SelectedAutocompleteItem) {
129 | this.selected.push(item.item);
130 |
131 | /**
132 | * Remove selected values from list,
133 | * selected value must be of type: {id: string(based on GUID's), [value: string]: any}[]
134 | */
135 | this.completer.RemovableValues('completer', this.selected)
136 | }
137 | ```
138 |
139 | # Turn off completion
140 | In some cases you may want to disable auto completion. e.g you want a html select element.
141 | ### Example
142 | 
143 | ### Usage
144 | ```typescript
145 | public group = [
146 | CreateNewAutocompleteGroup(
147 | 'Search / choose in / from list',
148 | 'completer',
149 | [
150 | {title: 'Option 1', id: '1'},
151 | {title: 'Option 2', id: '2'},
152 | {title: 'Option 3', id: '3'},
153 | {title: 'Option 4', id: '4'},
154 | {title: 'Option 5', id: '5'},
155 | ],
156 | {titleKey: 'title', childrenKey: null},
157 | '',
158 | false
159 | )
160 | ];
161 | ```
162 |
163 | # With children
164 | ### Usage
165 | ```typescript
166 | public group = [
167 | CreateNewAutocompleteGroup(
168 | 'Search / choose in / from list',
169 | 'completer_one',
170 | [
171 | {
172 | title: 'Option 1', id: '1',
173 | children: [
174 | {title: 'Option 1', id: '1'},
175 | {title: 'Option 2', id: '2'}
176 | ]
177 | },
178 | {
179 | title: 'Option 2', id: '2',
180 | children: [
181 | {title: 'Option 3', id: '3'},
182 | {title: 'Option 4', id: '4'}
183 | ]
184 | },
185 | {
186 | title: 'Option 3', id: '3',
187 | children: [
188 | {title: 'Option 5', id: '5'},
189 | {title: 'Option 6', id: '6'}
190 | ]
191 | },
192 | ],
193 | {titleKey: 'title', childrenKey: 'children'},
194 | ''
195 | ),
196 | CreateNewAutocompleteGroup(
197 | 'Search / choose in / from list',
198 | 'completer_two',
199 | [
200 | {title: 'Option 1', id: '1'},
201 | {title: 'Option 2', id: '2'},
202 | {title: 'Option 3', id: '3'},
203 | {title: 'Option 4', id: '4'},
204 | {title: 'Option 5', id: '5'},
205 | {title: 'Option 6', id: '6'},
206 | ],
207 | {titleKey: 'title', childrenKey: null},
208 | 'completer_one'
209 | )
210 | ];
211 | ```
212 |
213 | # Within a form
214 |
215 | ### Usage:
216 | ```typescript
217 | import {Component, OnInit, ViewChild} from "@angular/core";
218 | import {FormArray, FormBuilder, FormGroup} from "@angular/forms";
219 | import {CreateNewAutocompleteGroup, SelectedAutocompleteItem, NgAutoCompleteComponent} from "ng-auto-complete";
220 |
221 | @Component({
222 | selector: 'app-root',
223 | templateUrl: './app.component.html',
224 | })
225 | export class AppComponent implements OnInit {
226 | @ViewChild(NgAutoCompleteComponent) public completer: NgAutoCompleteComponent;
227 |
228 | public form: FormGroup;
229 | public group = [
230 | CreateNewAutocompleteGroup(
231 | 'Search / choose in / from list',
232 | 'completer',
233 | [
234 | {title: 'Option 1', id: '1'},
235 | {title: 'Option 2', id: '2'},
236 | {title: 'Option 3', id: '3'},
237 | {title: 'Option 4', id: '4'},
238 | {title: 'Option 5', id: '5'},
239 | ],
240 | {titleKey: 'title', childrenKey: null}
241 | ),
242 | ];
243 |
244 | constructor(private _fb: FormBuilder) {
245 |
246 | }
247 |
248 | /**
249 | *
250 | */
251 | ngOnInit() {
252 | this.form = this._fb.group({
253 | items: new FormArray([])
254 | });
255 | }
256 |
257 | /**
258 | *
259 | * @param item
260 | * @constructor
261 | */
262 | Selected(item: SelectedAutocompleteItem) {
263 | this.form.controls['items'] = this._fb.array([...this.form.controls['items'].value, item.original]);
264 |
265 | console.log(item);
266 | }
267 | }
268 | ```
269 |
270 | # Changelog - (Read before updating.)
271 | ## [4.1.9]
272 | - Internal fixes & performance improvements.
273 | ## [4.1.6]
274 | - I.E fixes
275 | ## [4.1.5]
276 | - New functions
277 | - SetEnable(key: string)
278 | - SetDisable(key: string)
279 | ## [4.1.4]
280 | - ExpressionChangedAfterItHasBeenCheckedError
281 | - Fixed this error in a previous version, this ends up in propagating the error, this isn't user friendly.
282 | - Since i must check something in the `ngAfterViewChecked` there is no escaping this error unless setTimeout is used (which i did now).
283 | ## [4.1.2]
284 | - Internal changes
285 | - The way how the first value was selected is changed. Package used to wait until view was checked, this was checked
286 | periodically via a interval. Now a subject has been created to emit this value to all their subscribers.
287 | - BREAKING:
288 | - `FindInput` function has been removed.
289 | ## [4.0.2] - [4.0.1] - [4.0.0]
290 | - Updates regarding angular 7
291 | ## [3.1.0]
292 | ### Important. Breaking changes!
293 | - NgAutocompleteComponent renamed to NgAutoCompleteComponent
294 | - Very big changes internally. Stopped using rollup to create my npm package.
295 | - Using angular libraries now instead.
296 | ## [3.0.0] - 2018-09-14.
297 | - Updated to newest version of angular.
298 | ## [2.10.5] - 2018-06-07
299 | - Fixed an maximum callstack exceeded bug.
300 | ## [2.10.3] / [2.10.4] - 2018-06-06
301 | - Added searchLength to options when create an autocomplete group, it configures when to fire a search. The number given is the amount of characters in the input.
302 | ## [2.10.2] - 2018-05-15.
303 | - Removed dropdown it's own comparison when using Async. Assuming the user will probably filter the results.
304 | ## [2.10.1] - 2018-05-14.
305 | - Added new classes to wrong element.
306 | ## [2.10.0] - 2018-05-14.
307 | - Changes to behaviour of the dropdown (mainly for async).
308 | - Dropdown now only opens when there's a default value at start. It will stay closed until it has a list to show. -- Represented by the class: is-initial-empty.
309 | - Dropdown now has a loading class; is-loading.
310 | - Internal changes to keep the new code compatible with new behaviour.
311 | ## [2.9.12] - 2018-05-11.
312 | ### New Functionality.
313 | - Support for async functions.
314 | - Useful for when you want to use your own API to return results.
315 | ```typescript
316 | @ViewChild(NgAutoCompleteComponent) public completer: NgAutoCompleteComponent;
317 |
318 | const async = (str: string) => {
319 | return new Promise((resolve) => {
320 | setTimeout(() => {
321 | resolve([
322 | {
323 | id: 0,
324 | title: `Test case 1 ${str}`
325 | },
326 | {
327 | id: 1,
328 | title: `Test case 2 ${str}`
329 | },
330 | {
331 | id: 2,
332 | title: `Test case 3 ${str}`
333 | }
334 | ])
335 | }, 2000)
336 | });
337 | };
338 |
339 | this.completer.SetAsync('completer', async);
340 | ```
341 | ## [2.8.12] - 2018-05-09.
342 | ### New Functionality.
343 | - Created new functions to add custom ng-templates.
344 | - Every ng template receives a context that's equal to an AutocompleteItem type. Except for the dropdownValue, this receives a hightlight too. see example
345 | - template parameter must be of type: dropdownValue | placeholderValue | noResults
346 | ```typescript
347 | @ViewChild(NgAutoCompleteComponent) public completer: NgAutoCompleteComponent;
348 |
349 | @ViewChild('dropdownValue') dropdownValue: TemplateRef;
350 | @ViewChild('placeholderValue') placeholderValue: TemplateRef;
351 | @ViewChild('noResults') noResults: TemplateRef;
352 |
353 | this.completer.SetTemplate('completer', 'dropdownValue', this.dropdownValue);
354 | this.completer.SetTemplate('completer', 'noResults', this.noResults);
355 | this.completer.SetTemplate('completer', 'placeholderValue', this.placeholderValue);
356 | ```
357 | ```html
358 |
359 |
360 |
361 |
362 |
363 | {{value.title}}
364 |
365 |
366 |
367 | Hey, you searched for: {{value}}. But there are no results!
368 |
369 | ```
370 | ## [2.7.12] - 2017-11-08.
371 | - Big performance refactor.
372 | - Instead of using arrays, now uses objects. Search by object key.
373 | - New @output, (no-results) emits GroupNoResult.
374 | ## [1.5.12], [1.6.12], [1.7.12] - 2017-08-29.
375 | - A lot of internal changes & bugfixes.
376 | - In some cases when the a view has a hidden ng-content, that shows if an expression evaluates to true and
377 | a completer function has been used e.g(`SelectItem('completer', 5)`) it would give an error; completer view is not
378 | initialized.
379 | - Functions that are called before the completer view has been initialized are now queued to be fired when the view
380 | is actually initialized.
381 | ## [1.4.12] - 2017-08-02.
382 | - Added tab to submit events. (not preventing default, so still goes to the next input, if there's one).
383 | - Added better support for navigating with arrows. Dropdown list now navigates to the selected item if the items exceed
384 | the dropdown its given height.
385 | - Internal code cleanup.
386 | ## [1.3.12] - 2017-07-21.
387 | - Mobile update: Remove mouseover when mobile. This prevents the user from needing to double tap the options.
388 | ## [1.3.11] - 2017-07-21.
389 | ### Styling
390 | - Some internal styling has changed.
391 | - When completer is turned of, input used to be disabled. This doesn't work on all browsers. Input now get
392 | `pointer-events: none;`
393 | - Browser compatibility.
394 | ### Fixes
395 | - Value has to be set on input (equal to ngModel).
396 | - This created an issue on safari, when an item was selected, the placeholder didn't go away.
397 |
398 |
399 | ## [1.3.9] - 2017-07-20.
400 | ### Styling
401 | - There's a new element `span.ng-autocomplete-dropdown-icon` this replaces the dropdown icon i did with css only.
402 | ### Other changes
403 | - Increase of internal performance.
404 | - Had some issues with Element refs. #fixed.
405 | ## [1.2.8] - 2017-07-15.
406 | ### New Functionality.
407 | - It's now possible to instantiate CreateNewAutocompleteGroup with an empty array and set its value later. This can be useful
408 | when you're waiting for an async task to complete.
409 | ```
410 | const component = NgAutoCompleteComponent.FindCompleter('completer', this.completers);
411 | component.SetValues(
412 | 'late', // <-- NOTE: this is the key of the input. You can call this what you want.
413 | [
414 | {title: 'Option 4', id: '1'},
415 | {title: 'Option 5', id: '2'},
416 | {title: 'Option 6', id: '3'},
417 | {title: 'Option 7', id: '4'},
418 | {title: 'Option 8', id: '5'},
419 | {title: 'Option 9', id: '6'},
420 | ]
421 | )
422 | ```
423 |
424 | - Created new pipe to highlight search query. class `dropdown-item-highlight`
425 | ### Changes
426 | - CreateNewAutocompleteGroup now accepts {id:string|number}, before only {id:string}
427 | - Some small changes.
428 | ## [1.1.6] - 2017-07-12.
429 | - KeyEvents now preventDefault
430 | - Close dropdown on tab.
431 | - Open dropdown on focus - was only on click.
432 | - Updated README.md.
433 |
434 | ## [1.1.5] - 2017-07-12.
435 | - Maintain active option when input is blurred - also for disabled completion inputs now.
436 | - Updated README.md.
437 |
438 | ## [1.1.4] - 2017-07-12.
439 | - Maintain active option when input is blurred.
440 | - Updated README.md.
441 |
442 | ## [1.1.3] - 2017-07-12.
443 | - Updated README.md.
444 |
445 | ## [1.1.2] - 2017-07-11.
446 | - Fixed an issue; when selecting a option from a completer that is parent, active child option didn't reset.
447 | - Updated README.md.
448 |
449 | ## [1.1.1] - 2017-07-11.
450 | ### New Functionality.
451 | - SelectItem(key: string, id: string)
452 | - NgAutoCompleteComponent function - Set value manual, by id. This can be useful when the list is loaded
453 | but there's a value set in the database. When the data is fetched from server, this method can be used.
454 | ```typescript
455 | @ViewChild(NgAutoCompleteComponent) public completer: NgAutoCompleteComponent;
456 | this.completer.SelectItem('completer', '1');
457 | ```
458 | ### Or if multiple completers in component.
459 |
460 | ```typescript
461 | @ViewChildren(NgAutoCompleteComponent) public completers: QueryList;
462 |
463 | const completer = NgAutoCompleteComponent.FindCompleter('group1', this.completers);
464 | completer.SelectItem('completer', '1');
465 | ```
466 |
467 | ## [1.0.1] - 2017-07-11.
468 | - Only groups with parents did a reset when the input reached a length <= 0. Now all inputs do, input with parents still get set to initial value.
469 |
470 | ## [1.0.0] - 2017-07-11. Releasing since it's being used.
471 | ### Renamed Functions.
472 |
473 | - ResetCompleters to ResetInputs.
474 | - ResetCompleter to ResetInput.
475 | - FindCompleter to FindInput.
476 | - TriggerChangeCompleters to TriggerChange.
477 |
478 | ### New Functionality.
479 | - - Added key on component.
480 | - static FindCompleter usage (NgAutoCompleteComponent.FindCompleter()) (not to be confused with the old FindCompleter, now FindInput)
481 | - (key: string, list: QueryList): NgAutoCompleteComponent. This can be useful when you have multiple ng-autocomplete components
482 | in one component. Note that this can only be used when the view has been init.
483 |
484 | # NgAutoCompleteComponent Functions
485 |
486 | ### Note:
487 |
488 |
I have made all NgAutoCompleteComponent and CompleterComponent functions public, so you could do a lot more than i'll show you
489 |
I've documented the functions of which i think their useful: