Skip to content

Commit c0b42f8

Browse files
author
John Doherty
committed
more documentation tweaks
1 parent e726ee1 commit c0b42f8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

README.MD

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ app.get('/', function(req, res){
2929
// respond to this request with our fake-new content embedded within the BBC News home page
3030
res.merge('fake-news', {
3131
sourceUrl: 'http://www.bbc.co.uk/news', // external url to fetch
32-
sourcePlaceholder: 'div[data-entityid="container-top-stories#1"]' // css selector to inject our content into
32+
sourcePlaceholder: 'div[data-entityid="container-top-stories#1"]', // css selector to inject our content into
33+
transform: null // pass function here to intercept the transofrm html prior to merging
3334
});
3435
});
3536
```
3637

38+
If you pass a function as the transform property ```transform: function($, model) {}``` - the function will be called prior to rendering, allowing you to inject title tags or html attributes.
39+
3740
## fake-news html
3841

3942
```html

lib/node-iframe-replacement.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ module.exports = function(req, res, next){
6969
}
7070

7171
/**
72-
* Converts template url to $ object
73-
* @param {string} sourceUrl - url to external template or html content
72+
* Converts source url to $ object
73+
* @param {string} sourceUrl - url to external html content
7474
*/
7575
function resolveTemplate(sourceUrl){
7676

0 commit comments

Comments
 (0)