Last active
April 12, 2017 17:17
-
-
Save ZoolWay/3da6d6aa70f6cdf84f1fb9b5f2109b6f to your computer and use it in GitHub Desktop.
Aurelia Resize
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="my-comp"></require> | |
<h1>Aurelia Reisze</h1> | |
<div ref="areaContainer"> | |
<h2>Component:</h2> | |
<my-comp title="simple"></my-comp> | |
<compose view-model="my-comp" model.bind="modelB"></compose> | |
</div> | |
<div> | |
<button click.delegate="to300()">To 300</button> | |
<button click.delegate="to500()">To 500</button> | |
</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
import { observable } from 'aurelia-framework' | |
export class App { | |
modelB = { title: 'inner-compose' }; | |
areaContainer = null; | |
to300() { | |
this.areaContainer.style.width = '300px'; | |
} | |
to500() { | |
this.areaContainer.style.width = '500px'; | |
} | |
} |
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="main"> | |
<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> | |
</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
//require(['https://unpkg.com/element-resize-detector@1.1.11/dist/element-resize-detector']); | |
//require(['https://unpkg.com/aurelia-resize@1.0.4/dist/amd/index']); | |
import { resizeable } from 'https://unpkg.com/aurelia-resize@1.0.4/dist/amd/index'; | |
export function configure(aurelia) { | |
aurelia.use.standardConfiguration(); //.plugin('https://unpkg.com/aurelia-resize@1.0.4/dist/index'); | |
aurelia.start().then(() => aurelia.setRoot()); | |
} |
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 style="font-family:Lucida Console Regular; padding: 1em; background: silver;"> | |
title: '${title}' | |
</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
import { bindable } from 'aurelia-framework' | |
export class MyComp { | |
@bindable title = null; | |
activate(model) { | |
if ((model) && (model.title)) { | |
this.title = model.title; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment