Skip to content

Commit

Permalink
docs: Example for form autocmplete selection
Browse files Browse the repository at this point in the history
  • Loading branch information
rubyboy committed Apr 29, 2017
1 parent 36b59cf commit 735a9c6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sample/src/app/components/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {Component,OnInit} from "@angular/core"
</div>
<div class="row">
<div class="input-field col s12">
<input type="text" name="autoComplete" materialize="autocomplete" [materializeParams]="[{'data': {'apple': null, 'google': null}}]" [attr.disabled]="isDisabled?true:null">
<input type="text" name="autoComplete" materialize="autocomplete" [materializeParams]="[autocompleteInit]" [attr.disabled]="isDisabled?true:null">
<label for="autoComplete">Autocomplete (a/g)</label>
</div>
</div>
Expand Down Expand Up @@ -151,6 +151,12 @@ export class Forms implements OnInit {
radioButtonValue = 3;

maxLength = 20;
autocompleteInit = {
'data': {'apple': null, 'google': null},
onAutocomplete: (val) => {
console.log(val);
},
};

public ngOnInit() {
window.setTimeout(()=>{
Expand Down

0 comments on commit 735a9c6

Please sign in to comment.