Created
January 22, 2015 21:59
-
-
Save tyv/4af5b5ca09c8076b5742 to your computer and use it in GitHub Desktop.
parent data access with riot
This file contains hidden or 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
<myparent> | |
<div>{ list[2] ? list[2].e : list[0].a }</div> | |
<mychild list={ list }></mychild> | |
this.list = [{ a: 'b' }, { c: 'd' }]; | |
</myparent> | |
<mychild> | |
// any HTML here | |
var parent = this.parent; | |
this.someHandler = function() { | |
opts.list.push({ e: 'f' }); | |
parent.update(); // HOW TO AVOID THIS? | |
} | |
</mychild> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment