Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
spat-ne-hochu committed Jun 20, 2016
1 parent ed7621b commit 1a2bdc3
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
# directives-provider

[![Build Status](http://travis-ci.org/combinejs/directives-provider.svg?branch=master)](https://travis-ci.org/combinejs/directives-provider)
[![Coverage Status](http://coveralls.io/repos/github/combinejs/directives-provider/badge.svg?branch=master)](https://coveralls.io/github/combinejs/directives-provider?branch=master)
[![Coverage Status](http://coveralls.io/repos/github/combinejs/directives-provider/badge.svg?branch=master)](https://coveralls.io/github/combinejs/directives-provider?branch=master)

### DirectiveProvider.provide(name)
directives provider resolve directive from project scope or node_modules folder.
for using your directive without publish in npm, place your directive to:

combinejs parsers call this method automatically, when parse blocks.

* [PROJECT]/combine/directives/[NAME].js
* [PROJECT]/combine/directives/[NAME]/index.js
* [PROJECT]/combine/directives/[NAME]-directive.js
* [PROJECT]/combine/directives/[NAME]-directive/index.js

```javascript
const DP = require('@combinejs/directives-provider');
let myDirective = new DP.provide('MyDirective');
```

### DirectiveProvider.define(name, directiveClass)
for special case you can define directive manual:

```javascript
const DP = require('@combinejs/directives-provider');
DP.define('myDirective', MyDirective);
```

0 comments on commit 1a2bdc3

Please sign in to comment.