Last active
December 3, 2018 10:13
-
-
Save Vallabharayudu/d0b3d10630d96685ce495171ac7b7f06 to your computer and use it in GitHub Desktop.
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
<template> | |
<require from="styles.css"></require> | |
<h1>${message}</h1> | |
<div class="container"> | |
<ul> | |
<li repeat.for="item of list" class="${item.isActive?'red':''}" click.delegate="clickItem(item)">${item.name}</li> | |
</ul> | |
</div> | |
</template> |
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
export class App { | |
message = 'Hello World!'; | |
constructor(){ | |
this.list = new Array(); | |
this.list.push(new Listitems('Vallabha',false)); | |
this.list.push(new Listitems('Mohan',false)); | |
this.list.push(new Listitems('Pranay',false)); | |
this.list.push(new Listitems('Ganapathi',false)); | |
} | |
clickItem(selectedItem){ | |
var targetIndex = this.list.indexOf(selectedItem); | |
//for(var i=0;i<this.list.length; i++){ | |
//this.list[i].isActive = false; | |
//} | |
this.list.forEach((item) => item.isActive = false) | |
this.list[targetIndex].isActive = true; | |
} | |
} | |
export class Listitems { | |
constructor(name,isActive){ | |
this.name = name; | |
this.isActive = isActive; | |
} | |
} | |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Aurelia</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body aurelia-app> | |
<h1>Loading...</h1> | |
<!--<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>--> | |
<script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/jspm_packages/system.js"></script> | |
<script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/config.js"></script> | |
<script> | |
System.import('aurelia-bootstrapper'); | |
</script> | |
</body> | |
</html> |
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
console.log('Hello World!'); |
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
/* todo: add styles */ | |
.red{ | |
color:red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment