Last active
December 31, 2015 22:49
-
-
Save nuysoft/8055993 to your computer and use it in GitHub Desktop.
Hyde.js 的双向绑定绑定过程
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
{ | |
"type": "program", | |
"statements": [ | |
{ | |
"type": "mustache", | |
"strip": { | |
"left": false, | |
"right": false | |
}, | |
"escaped": true, | |
"id": { | |
"type": "ID", | |
"original": "title", | |
"parts": [ | |
"title" | |
], | |
"string": "title", | |
"depth": 0, | |
"isSimple": true, | |
"stringModeValue": "title" | |
}, | |
"params": [], | |
"eligibleHelper": true | |
} | |
], | |
"strip": {} | |
} |
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
{ | |
"type": "program", | |
"statements": [ | |
{ | |
"type": "content", | |
"string": "<script guid="9" slot="start" type="" path="" | |
}, | |
{ | |
"type": "mustache", | |
"strip": { | |
"left": false, | |
"right": false | |
}, | |
"escaped": true, | |
"id": { | |
"type": "ID", | |
"original": "$lastest", | |
"parts": [ | |
"$lastest" | |
], | |
"string": "$lastest", | |
"depth": 0, | |
"isSimple": true, | |
"stringModeValue": "$lastest" | |
}, | |
"params": [ | |
{ | |
"type": "ID", | |
"original": "title", | |
"parts": [ | |
"title" | |
], | |
"string": "title", | |
"depth": 0, | |
"isSimple": true, | |
"stringModeValue": "title" | |
} | |
], | |
"eligibleHelper": true, | |
"isHelper": 1, | |
"binded": true | |
}, | |
{ | |
"type": "content", | |
"string": "" isHelper="false"></script>" | |
}, | |
{ | |
"type": "mustache", | |
"strip": { | |
"left": false, | |
"right": false | |
}, | |
"escaped": true, | |
"id": { | |
"type": "ID", | |
"original": "title", | |
"parts": [ | |
"title" | |
], | |
"string": "title", | |
"depth": 0, | |
"isSimple": true, | |
"stringModeValue": "title" | |
}, | |
"params": [], | |
"eligibleHelper": true, | |
"binded": true | |
}, | |
{ | |
"type": "content", | |
"string": "<script guid="9" slot="end"></script>" | |
} | |
], | |
"strip": {} | |
} |
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
<script src="/dist/hyde.js"></script> | |
<script> | |
// http://cemerick.github.io/jsdifflib/demo.html | |
var tpl = '{{title}}' | |
var ast = Handlebars.parse(tpl) | |
console.log( JSON.stringify(ast, null, 4) ) | |
AST.handle(ast) | |
console.log( JSON.stringify(ast, null, 4) ) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment