Skip to content

Commit

Permalink
readme misunderstood fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JiLiZART committed Nov 18, 2017
1 parent 6586a4b commit 8cbebec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 62,23 @@ Using dependency injection you could just swap out the binding for your HTTP ser

Simply put, in your code you could have:
```javascript
import Axios from 'axios';

Vue.$ioc.register('$http', Axios);

function convertCurrency() {}

Vue.$ioc.register(convertCurrency); // will be registered as 'convertCurrency'

class PostService {}

Vue.$ioc.register(new PostService()); // will be registered as 'PostService'
```
And for your unit tests you could overwrite the binding
```javascript
Vue.$ioc.register('$http', AxiosDummyModule);
Vue.$ioc.register('convertCurrency', DummyFunc);
Vue.$ioc.register('PostService', DummyService);
```
Your components however remain entirely unchanged.

Expand Down

0 comments on commit 8cbebec

Please sign in to comment.