Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
update(tabs): prevents autofill on demo page for autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Messerle committed Mar 23, 2015
1 parent 49d8434 commit d484fc8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 43 deletions.
41 changes: 18 additions & 23 deletions src/components/autocomplete/demoBasicUsage/index.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
<div ng-app="autocompleteDemo" ng-controller="DemoCtrl as ctrl" layout="column">

<md-content class="md-padding" layout="column">
<p>
Use <code>&lt;md-autocomplete&gt;</code> to search for matches from local or remote data sources.
</p>

<md-autocomplete
ng-disabled="ctrl.isDisabled"
md-no-cache="ctrl.noCache"
md-selected-item="ctrl.selectedItem"
md-search-text="ctrl.searchText"
md-items="item in ctrl.querySearch(ctrl.searchText)"
md-item-text="item.display"
placeholder="What is your favorite US state?">
<span md-highlight-text="ctrl.searchText">{{item.display}}</span>
</md-autocomplete>

<br/>
<md-checkbox ng-model="ctrl.simulateQuery">Simulate query for results?</md-checkbox>
<md-checkbox ng-model="ctrl.noCache">Disable caching of queries?</md-checkbox>
<md-checkbox ng-model="ctrl.isDisabled">Disable the input?</md-checkbox>

<p style="padding-left: 15px;">By default, <code>&lt;md-autocomplete&gt;</code> will cache results when performing a query. After the initial call is performed, it will use the cached results to eliminate unnecessary server requests or lookup logic. This can be disabled above.</p>
<form ng-submit="$event.preventDefault()">
<p>Use <code>&lt;md-autocomplete&gt;</code> to search for matches from local or remote data sources.</p>
<md-autocomplete
ng-disabled="ctrl.isDisabled"
md-no-cache="ctrl.noCache"
md-selected-item="ctrl.selectedItem"
md-search-text="ctrl.searchText"
md-items="item in ctrl.querySearch(ctrl.searchText)"
md-item-text="item.display"
placeholder="What is your favorite US state?">
<span md-highlight-text="ctrl.searchText">{{item.display}}</span>
</md-autocomplete>
<br/>
<md-checkbox ng-model="ctrl.simulateQuery">Simulate query for results?</md-checkbox>
<md-checkbox ng-model="ctrl.noCache">Disable caching of queries?</md-checkbox>
<md-checkbox ng-model="ctrl.isDisabled">Disable the input?</md-checkbox>

<p style="padding-left: 15px;">By default, <code>&lt;md-autocomplete&gt;</code> will cache results when performing a query. After the initial call is performed, it will use the cached results to eliminate unnecessary server requests or lookup logic. This can be disabled above.</p>
</form>
</md-content>

</div>
39 changes: 19 additions & 20 deletions src/components/autocomplete/demoFloatingLabel/index.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<div ng-app="autocompleteFloatingLabelDemo" ng-controller="DemoCtrl as ctrl" layout="column">

<md-content class="md-padding" layout="column">
<p>The following example demonstrates floating labels being used as a normal form element.</p>

<div layout-gt-sm="row">
<md-input-container flex>
<label>Name</label>
<input type="text"/>
</md-input-container>
<md-autocomplete flex
ng-disabled="ctrl.isDisabled"
md-no-cache="ctrl.noCache"
md-selected-item="ctrl.selectedItem"
md-search-text="ctrl.searchText"
md-items="item in ctrl.querySearch(ctrl.searchText)"
md-item-text="item.display"
md-floating-label="Favorite state">
<span md-highlight-text="ctrl.searchText">{{item.display}}</span>
</md-autocomplete>
</div>

<form ng-submit="$event.preventDefault()">
<p>The following example demonstrates floating labels being used as a normal form element.</p>
<div layout-gt-sm="row">
<md-input-container flex>
<label>Name</label>
<input type="text"/>
</md-input-container>
<md-autocomplete flex
ng-disabled="ctrl.isDisabled"
md-no-cache="ctrl.noCache"
md-selected-item="ctrl.selectedItem"
md-search-text="ctrl.searchText"
md-items="item in ctrl.querySearch(ctrl.searchText)"
md-item-text="item.display"
md-floating-label="Favorite state">
<span md-highlight-text="ctrl.searchText">{{item.display}}</span>
</md-autocomplete>
</div>
</form>
</md-content>

</div>

0 comments on commit d484fc8

Please sign in to comment.