Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.
/ input-blocker Public archive

Angular directive for bootstrap. Allows blocking input with user provided template. Mostly useful for typeahead inputs.

Notifications You must be signed in to change notification settings

iisg/input-blocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular Bootstrap Input Blocker

Angular Bootstrap Input Blocker is a directive for bootstrap, which allows blocking input with user provided template. It is mostly useful for typeahead inputs, where modelValue contains more information than just simple string.

Demo

Demo can be viewed here.

Installation

Just require the package using bower:

bower install iisg/input-blocker --save

Usage

1st step: Require the fslab.inputblocker in your main module.

angular.module('myApp', [..., 'fslab.inputblocker'])

2nd step: Add fslab-input-blocker directive to existing input (example with ui-bootstrap typeahead). No other attributes are needed.

<input type="text"
       ng-model="selected"
       class="form-control"
       uib-typeahead="browser as browser.name for browser in browsers"
       typeahead-editable="false"
       fslab-input-blocker>

Custom template can be used by assigning value to fslab-input-blocker.

<script type="text/ng-template"
        id="addressTemplate">
    <a target="_blank" ng-href="{{value.address}}">
        {{value.name}}
    </a>
</script>
<input type="text"
       ng-model="selected"
       class="form-control"
       uib-typeahead="browser as browser.name for browser in browsers"
       typeahead-editable="false"
       fslab-input-blocker='addressTemplate'>

About

Angular directive for bootstrap. Allows blocking input with user provided template. Mostly useful for typeahead inputs.

Resources

Stars

Watchers

Forks

Packages

No packages published