{{ cowsayCtrl.title }}
+ +
+ {{ cowsayCtrl.update(cowsayCtrl.text) }}
+
+
+
+ diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..af0f0c3 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/app/entry.js b/app/entry.js new file mode 100644 index 0000000..1e346d5 --- /dev/null +++ b/app/entry.js @@ -0,0 +1,59 @@ +'use strict'; + +require("./scss/reset.scss"); +require("./scss/main.js"); + +const angular = require('angular'); +const cowsay = require('cowsay-browser'); + +cowsayApp.controller(CowsayController, ['$log', CowsayController]); + +function CowsayController($log) { + $log.debug('CowsayController'); + + this.title = 'Welcome to the land of cows!'; + this.history = []; + + cowsay.list((err, cowfiles) => { + this.cowfiles = cowfiles; + this.current = this.cowfiles[0]; + }); + + this.update = (input) => { + $log.debug('cowsayCtrl.update()'); + return cowsay.say({text: input || 'FUUUUUUUUDDDGE', f: this.current}); + }; + + this.speak = (input) => { + $log.debug('cowsayCtrl.speak()'); + this.spoken = this.update(input); + this.history.push(this.spoken); + }; + + this.undo = (input) => { + $log.debug('cowsayCtrl.undo()'); + this.history.pop(); + this.spoken = this.history.pop() || ''; + }; +} + +cowsayApp.controller('NavController', ['$log', NavController]); + +function NavController($log) { + $log.debug('NavController'); + + this.routes = [ + { + name: 'home', + url: '/home' + }, + { + name: 'about', + url: '/about-us' + }, + { + name: 'contact', + url: '/contact-us' + } + ]; +} diff --git a/app/index.html b/app/index.html new file mode 100644 index 0000000..e4f3045 --- /dev/null +++ b/app/index.html @@ -0,0 +1,50 @@ + + +
+
+ {{ cowsayCtrl.update(cowsayCtrl.text) }}
+
+
+
+