1
0
mirror of https://github.com/bobwen-dev/react-templates synced 2025-04-12 00:56:39 +02:00

Fixed rt-repeat sample to include execution context

This commit is contained in:
Amit Kaufman 2014-11-25 17:03:25 +02:00
parent 8952d19789
commit 99a52cf935

View File

@ -84,7 +84,7 @@ Repeats a node with its subtree for each item in an array. This is implemented b
###### Sample:
```html
<div rt-repeat="myNum in this.getMyNumbers()">{myNumIndex}. myNum</div>
<div rt-repeat="myNum in this.getMyNumbers()">{myNumIndex}. {myNum}</div>
```
###### Compiled:
```javascript
@ -94,7 +94,7 @@ define([
], function (React, _) {
'use strict';
function repeatMyNum1(myNum, myNumIndex) {
return React.DOM.div({}, myNumIndex + '. myNum');
return React.DOM.div({}, myNumIndex + '. ' + myNum);
}
return function () {
return _.map(this.getMyNumbers(), repeatMyNum1.bind(this));