Skip to content

drpicox/drpx-bind-angular

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drpxBindAngular

A simple angular directive that binds an angular to be compiled text

Angular has ngBindTemplate, which binds a simple template, but it cannot be used to instance directives. This directive allows to do such thing:

    <!-- in controller vm.template = '<yourDirective arg="{{n}}></yourDirective>'; -->
    <span drpx-bind-angular="vm.template"></span>

You can use this directive to parametrize your directives and enhance its behaviour.

Install with Npm

$ npm install --save drpx-bind-angular

add to your module the dependence:

    angular.module('yourModule', [ require('drpx-bind-angular') ]);

Install with Bower

$ bower install --save drpx-bind-angular

add to your module the dependence:

    angular.module('yourModule', ['drpxBindAngular']);

include the javascript library in your application:

<script src="bower_components/drpx-bind-angular/drpx-bind-angular.js"></script>

How to use

Configure a scope variable with the content of the template that you want to bind and use the drpxBindAngular:

    <span drpx-bind-angular="vm.template"></span>

About

A simple angular directive that binds an angular html

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •