Skip to content

Commit

Permalink
Updates Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Finn Heemeyer committed Nov 18, 2014
1 parent 624be0c commit 74c26bc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,27 @@ ich.templateExtension = 'tpl';

ich.load('template', function() {
// Called when template has been loaded
ich.template({
var content = ich.template({
foo: 'bar'
});

$element.html(content);
});

```

Call `ich.load` as many times as you want, the template will be only requested once.

**But wait**, there is an even shorter method:

```javascript

ich.loadTemplate('template', { foo: 'bar' }, function($content) {
$element.html($content);
});

```

## Installation

Just load `ICanHaz.load.js` somewhere after `ICanHaz.js` and `jQuery` and you're good to go.
Expand Down

0 comments on commit 74c26bc

Please sign in to comment.