Skip to content

Instantly share code, notes, and snippets.

View freshcutdevelopment's full-sized avatar

Sean Hunter freshcutdevelopment

View GitHub Profile
<!-- app/test.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<h1>test</h1>
export function getStatus(){
console.log('JSPM set up correctly!');
}
// app/app.js
import {getStatus} from 'status';
getStatus();
<!-- app/test.html -->
<!DOCTYPE html>
<html>
...
<body>
<h1>test</h1>
<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
System.import('app');
<!-- app/test.html -->
<!DOCTYPE html>
<html>
...
<body>
<h1>test</h1>
<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
System.import('app');
// app/app.js
export class App{
constructor(){
this.status = "Aurelia has been Bootstrapped"+
"loading corresponding view for "+
"this view-model.. looking for app.html";
}
}
<!-- app/app.html -->
<template>
<h1>${status}</h1>
</template>
<!-- app/test.html -->
<!DOCTYPE html>
<html>
...
<body>
<h1>Status - Page</h1>
<div class="jumbotron">
<div aurelia-app>
</div>
</div>
var calculator = (function () {
return {
add: function(x, y){
return x + y;
},
subtract: function(x,y){
return x - y;
}
};
//------ calculator.js ------
export function add(x) {
return x + y;
}
export function subtract(x, y) {
return x - y;
}