Last active
May 28, 2018 22:37
-
-
Save santospatrick/6f5d249055d5c357d5705eca02a5a7e7 to your computer and use it in GitHub Desktop.
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
/** | |
* Pure javascript responsability: | |
* http to get cultures then add it to | |
* 'cultures' variable and then reuse | |
* the transformers we wrote | |
*/ | |
// Vue.js | |
<ul> | |
<li v-for="item in getNames(cultures)">{{ item }}</li> | |
<strong>{{ totalQuantity(cultures) }}</strong> | |
<pre>{{ energies(cultures) | json 2 }}</pre> | |
</ul> | |
// Angular.js | |
<ul> | |
<li ng-repeat="item in getNames(cultures)">{{ item }}</li> | |
<strong>{{totalQuantity(cultures)}}</strong> | |
<pre>{{ energies(cultures) | json: 2 }}</pre> | |
</ul> | |
// React.js | |
<ul> | |
{getNames(cultures).map(item => <li>{{ item }}</li>)} | |
<strong>{{totalQuantity(cultures)}}</strong> | |
<pre>{JSON.stringify(energies(cultures), null, 2)}</pre> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment