This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Full width search box with icons and actions associated to List and Grid Views --> | |
<!-- Requires Angular (1.3 used here), Bootstrap (3), and Font Awesome --> | |
<div class="row"> | |
<div class="input-group m-b"> | |
<span class="input-group-addon"><i class="fa fa-search"> </i></span> | |
<!-- auto-focus is a directive also found as a gist here. It sets the focus to an element on load. --> | |
<input class="form-control" auto-focus ng-init="$scope.searchQuery = $stateParams.query" type="text" minlength="3" maxlength="100" ng-model="searchQuery" placeholder="Search..."> | |
<!-- List and Grid view buttons. Other elements watch listView and change as it does. --> | |
<!-- If using more than two states, this will need to be reworked. But it's easier as a boolean --> | |
<div class="input-group-addon"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* app.autoFocus Module | |
* | |
* Simple directive to focus the element whem DOM ready | |
*/ | |
'use strict'; | |
angular | |
.module('app.autoFocus', []) | |
.directive('autoFocus', function($timeout) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |