Skip to content

lab-shiv #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
File renamed without changes.
29 changes: 29 additions & 0 deletions lab-shiv/app/entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use strict';

require('./scss/reset.scss');
require('./scss/main.scss');

const angular = require('angular');
const cowsay = require('cowsay-browser');

const cowsayApp = angular.module('cowsayApp', []);

cowsayApp.controller('CowsayController', ['$log', '$scope', CowsayController]);

function CowsayController($log, $scope) {
$log.debug('CowsayController');

let cowsayCtrl = $scope.cowsayCtrl= {};

cowsayCtrl.title = 'Welcome to Cowville!';

cowsayCtrl.speak = function(input) {
$log.debug('cowsayCtrl.speak()');
return cowsay.say({ text: input || 'moooooooo' });
};

cowsayCtrl.logger = function(input) {
$log.debug('cowsayCtrl.logger()');
$log.log(input);
};
};
27 changes: 27 additions & 0 deletions lab-shiv/app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html ng-app="cowsayApp">
<head>
<title>Welcome to Cowville!</title>
</head>
<body>
<main>
<section class="container" ng-controller="CowsayController">
<h2>{{ cowsayCtrl.title }}</h2>

<pre class="cow">
{{ cowsayCtrl.speak(cowsayCtrl.text) }}
</pre>

<input type="text" ng-model="cowsayCtrl.text">
<button ng-click="cowsayCtrl.logger(cowsayCtrl.text)">Log it!</button>
</section>

<section class="container" ng-controller="CowsayController">
<h2>2 Way Data Binding!</h2>

<p class="text-binder">{{ cowsayCtrl.bindText }}</p>
<input type="text" ng-model="cowsayCtrl.bindText">
</section>
</main>
</body>
</html>
Empty file added lab-shiv/app/scss/main.scss
Empty file.
48 changes: 48 additions & 0 deletions lab-shiv/app/scss/reset.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
Loading