-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed7621b
commit 1a2bdc3
Showing
1 changed file
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
``` | ||
|