Skip to content

UstymUkhman/tf-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tf-template

tf-template version tf-template release tf-template license Gitter

AngularJS directive - true/false template loading

Angular.js comes with several built-in validation mechanism for input fields (ngRequired, ngPattern etc.), however, by using this directive it's possible to handle both validation outcome (true or false) by specifying a custom template for each of results (or just for one of them). The tf-template directive makes it easy to use any variable(s) defined in scope as a validator variable(s). A validator variable will trigger directive's validation process every time the variable(s) changes.

Demo

You can test 'tf-template' here.

Requirements

  • AngularJS

Usage

You can get it from Bower

bower install git://github.com/UstymUkhman/tf-template.git

Load the script files in your application:

<script type="text/javascript" src="bower_components/angular/angular.min.js"></script>
<script type="text/javascript" src="bower_components/tf-template/source/tf-template.min.js"></script>

Add the specific module to your dependencies:

angular.module('myApp', ['tf.template', ...])
OR

You can just download this repository:

git clone https://github.com/UstymUkhman/tf-template.git

Use the script file in your application:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
<script type="text/javascript" src="./src/tf-template.min.js"></script>

And add the module to your dependencies:

angular.module('myApp', ['tf.template', ...])

About

AngularJS directive - true/false template loading

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors