Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
chore(typeahead): split template to external file
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcrea committed Jan 22, 2014
1 parent 51545fc commit 57f0fa6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
15 changes: 1 addition & 14 deletions src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,13 @@

angular.module('mgcrea.ngStrap.typeahead', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])

.run(function($templateCache) {

var template = '' +
'<ul tabindex="-1" class="typeahead dropdown-menu" ng-show="$isVisible()" role="select">' +
'<li role="presentation" ng-repeat="match in $matches" ng-class="{active: $index == $activeIndex}">' +
'<a role="menuitem" tabindex="-1" ng-click="$select($index, $event)" ng-bind="match.label"></a>' +
'</li>' +
'</ul>';

$templateCache.put('$typeahead', template);

})

.provider('$typeahead', function() {

var defaults = this.defaults = {
animation: 'animation-fade',
prefixClass: 'typeahead',
placement: 'bottom-left',
template: '$typeahead',
template: 'typeahead/typeahead.tpl.html',
trigger: 'focus',
container: false,
keyboard: true,
Expand Down
5 changes: 5 additions & 0 deletions src/typeahead/typeahead.tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ul tabindex="-1" class="typeahead dropdown-menu" ng-show="$isVisible()" role="select">
<li role="presentation" ng-repeat="match in $matches" ng-class="{active: $index == $activeIndex}">
<a role="menuitem" tabindex="-1" ng-click="$select($index, $event)" ng-bind="match.label"></a>
</li>
</ul>

0 comments on commit 57f0fa6

Please sign in to comment.