This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
pure.map method
This is the method to apply directives to an HTML
pure.map( directives, html [, noClone] )Parameters:
directives | object | This is the commands to tell PURE how to link the JSON data and the HTML. See more information about directive at What is a directive ? | ||||
html | DOM | This is the HTML template we want to transform with the data | ||||
noClone (optional) | boolean |
|
Output:
| html | DOM | This method returns a string with the HTML transformed. It can then be inserted in the innerHTML of an element. |
Behind the scene
The function map is converting the directives to HTML attributes.
The format of these attributes is as follow:
- pure:nodeValue=“firstName”
To set the node value of an element to the property ‘firstName’ of the data. - pure:href=“http://beebole.com”
To set the value of an attribute, here ‘href’ from the element - pure:repeat=“line <- lines”
To repeat the element for each ‘lines’ in our data and call the current item ‘line’
Setting manually such “pure:” attributes will drive to the same result at the compilation
So if your HTML is like below, you’ll get exactly the same result as the example Basic – Hello Who?:
<div id="hello">
Hello <span pure:nodeValue="firstName">World</span>
Note for Internet Explorer
IE has a very poor handling of HTML/XML namespaces.
PURE detects the browser and sets the name space to ‘pure_’ instead of the standard XML notation ‘pure:’
Nothing really interesting here, except if you have the idea to call some expandos attribute ‘pure_something’.






