diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-09-08 12:49:53 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-09-08 12:49:53 +0200 |
commit | 615a043031f37fe5bc55fdf9cbc2e83a5e305908 (patch) | |
tree | 128a22f4d34934ec7c7d75a78ffea7c16c7c32fb /src/BeerDukeTap.js | |
parent | bcf3120d437da01fda78397a345bf805b008eb7a (diff) | |
download | beer-duke-615a043031f37fe5bc55fdf9cbc2e83a5e305908.tar.gz beer-duke-615a043031f37fe5bc55fdf9cbc2e83a5e305908.tar.bz2 beer-duke-615a043031f37fe5bc55fdf9cbc2e83a5e305908.tar.xz beer-duke-615a043031f37fe5bc55fdf9cbc2e83a5e305908.zip |
wip
Diffstat (limited to 'src/BeerDukeTap.js')
-rw-r--r-- | src/BeerDukeTap.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/BeerDukeTap.js b/src/BeerDukeTap.js new file mode 100644 index 0000000..3392e85 --- /dev/null +++ b/src/BeerDukeTap.js @@ -0,0 +1,45 @@ +import angular from 'angular'; +import 'angular-route'; +import './BeerDuke.js'; + +class BeerDukeTapController { + constructor($timeout, BeerDukeSettings) { + console.log('BeerDukeTapController', this); + + this.$timeout = $timeout; + this.settings = BeerDukeSettings; + + this.rotateCode(); + this.count = 0; + this.code = ''; + } + + rotateCode() { + this.code = '' + this.count++; + this.$timeout(() => { + this.rotateCode(); + }, 1000); + } +} + +class TapSettingsController { + constructor() { + } +} + +function run(BeerDukeService) { + BeerDukeService.connect('tap'); +} + +function config($routeProvider) { + $routeProvider + .when('/', { + controller: BeerDukeTapController, + controllerAs: 'ctrl', + templateUrl: 'templates/tap.html' + }); +} + +angular.module('BeerDukeTap', ['BeerDuke', 'ngRoute']) + .run(run) + .config(config); |