Last active
February 12, 2017 23:23
-
-
Save lstarky/20495ff4f507472936b0ae5c99058bac to your computer and use it in GitHub Desktop.
Displaying the Json result in Table with some logic
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
<template> | |
<div class="container-fluid"> | |
<h1>Table Method</h1> | |
<table width="100%"> | |
<td> | |
<div repeat.for="field of myData" if.bind="field.order % 2"> | |
<p><b>${field.Key}:</b> ${field.value}</p> | |
</div> | |
</td> | |
<td> | |
<div repeat.for="field of myData" if.bind="!(field.order % 2)"> | |
<p><b>${field.Key}:</b> ${field.value}</p> | |
</div> | |
</td> | |
</table> | |
<h1>Bootstrap Method (Responsive)</h1> | |
<p><i>The second column will wrap down below on smaller screens... if you see it in one column, try widening the screen</i></p> | |
<div class="row"> | |
<div class="col-xs-6"> | |
<div repeat.for="field of myData" if.bind="field.order % 2"> | |
<p><b>${field.Key}:</b> ${field.value}</p> | |
</div> | |
</div> | |
<div class="col-xs-6"> | |
<div repeat.for="field of myData" if.bind="!(field.order % 2)"> | |
<p><b>${field.Key}:</b> ${field.value}</p> | |
</div> | |
</td> | |
</div> | |
</div> | |
</template> |
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
export class App { | |
myData = [{"Key":"Name","value":"Sriram","order":"01"},{"Key":"Email","value":"sriram@gmail","order":"02"},{"Key":"Genader","value":"male","order":"03"},{"Key":"DOB","value":"01-01-88","order":"04"},{"Key":"MobileNo","value":"999999999","order":"05"},{"Key":"Address","value":"","order":"06"}]; | |
} |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Aurelia</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
</head> | |
<body aurelia-app="main"> | |
<script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script> | |
<script src="https://jdanyow.github.io/rjs-bundle/config.js"></script> | |
<script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script> | |
<script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script> | |
<script> | |
require(['aurelia-bootstrapper']); | |
</script> | |
</body> | |
</html> |
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
export function configure(aurelia) { | |
aurelia.use | |
.standardConfiguration() | |
.developmentLogging(); | |
aurelia.start().then(() => aurelia.setRoot()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment