-
-
Save smithaitufe/0f7ecd5e560fa2631c11 to your computer and use it in GitHub Desktop.
Aurelia If Bind test on template part
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> | |
<require from ='personal-data'></require> | |
<require from ='child'></require> | |
<require from ='people'></require> | |
<h2>Simple App</h2> | |
<h5>Hi ${firstName}</h5> | |
<div repeat.for="people of peoples"> | |
<people firstname.bind="people.firstname" lastname.bind="people.lastname"></people> | |
</div> | |
<people firstname="Smith" lastname="Samuel"></people> | |
<personal-data registration-no.bind="reg"></personal-data> | |
<child greetings="Hello Friend"></child> | |
</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
import {autoinject} from 'aurelia-framework'; | |
import {peoples} from 'data' | |
@autoinject | |
export class App { | |
firstName = 'Jason'; | |
reg = 'w4r342343' | |
constructor() { | |
this.peoples = peoples | |
} | |
attached(){ | |
} | |
} |
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> | |
${greetings} | |
</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
import {bindable} from 'aurelia-framework' | |
export class Child | |
{ | |
@bindable greetings = "Hello world" | |
} |
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 const peoples = [ | |
{firstname: 'Harry', lastname: 'Gold'}, | |
{firstname: 'Robbinson', lastname: 'Hood'}, | |
{firstname: 'Friday', lastname: 'Simons'}, | |
] |
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"> | |
</head> | |
<body aurelia-app> | |
<h1>Loading...</h1> | |
<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 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> | |
<h2>Name: ${fullName()}</h2> | |
<strong>firstName: ${firstname}</strong> | |
<strong>lastName: ${lastname}</strong> | |
<hr/> | |
</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
import {bindable} from 'aurelia-framework' | |
export class People{ | |
@bindable firstname | |
@bindable lastname | |
fullName(){ | |
return `${this.firstname} ${this.lastname}` | |
} | |
FullName(){ | |
return `${this.firstname} ${this.lastname}` | |
} | |
} |
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> | |
${registrationNo} | |
</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
import {bindable, children} from 'aurelia-framework' | |
export class PersonalData{ | |
@bindable registrationNo | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment