Skip to content

Instantly share code, notes, and snippets.

Created Feb 24, 2017
Embed
What would you like to do?
Aurelia Gist
<template>
<require from="bootstrap/css/bootstrap.css"></require>
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<a class="navbar-brand" href="#">
<i class="fa fa-user"></i>
<span>
Open API Designer
</span>
</a>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-6">
<h2>
Design view
</h2>
Form fields placeholder
<div class="form-group">
<label for="name">
API Name
</label>
<input type="text" class="form-control" id="name" placeholder="Email" value.bind="swagger.name">
</div>
<div class="form-group">
<label for="name">
API Version
</label>
<input type="text" class="form-control" id="name" placeholder="Email" value.bind="swagger.version">
</div>
</div>
<div class="col-md-6">
<h2>JSON Preview</h2>
<pre>
${swaggerString}
</pre>
</div>
</div>
</div>
</template>
import {computedFrom} from 'aurelia-framework';
export class App {
swagger;
constructor() {
this.swagger = {
name: 'Swagger doc',
version: 1
};
}
get swaggerString() {
console.log(this.swagger);
const swaggerStringified = JSON.stringify(this.swagger);
return swaggerStringified;
}
}
<!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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment