From e2b4c87c036608b7169161996ba93f54a4b07fe7 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 8 Oct 2015 10:55:27 -0700 Subject: [PATCH] [CLI] Receive input --- ideas/cli/bundle.json | 7 +++++++ ideas/cli/res/templates/cli.html | 8 +++++--- ideas/cli/src/CLIController.js | 16 ++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 ideas/cli/src/CLIController.js diff --git a/ideas/cli/bundle.json b/ideas/cli/bundle.json index 2ad4015b3e..df8d13d76f 100644 --- a/ideas/cli/bundle.json +++ b/ideas/cli/bundle.json @@ -5,6 +5,13 @@ "when": "/cli", "templateUrl": "templates/cli.html" } + ], + "controllers": [ + { + "key": "CLIController", + "implementation": "CLIController.js", + "depends": [ "$scope" ] + } ] } } diff --git a/ideas/cli/res/templates/cli.html b/ideas/cli/res/templates/cli.html index f8064b4261..c84c61c08d 100644 --- a/ideas/cli/res/templates/cli.html +++ b/ideas/cli/res/templates/cli.html @@ -1,8 +1,10 @@ -
+
- {{line}} + {{line}}
- +
+ +
diff --git a/ideas/cli/src/CLIController.js b/ideas/cli/src/CLIController.js new file mode 100644 index 0000000000..c0f7235c06 --- /dev/null +++ b/ideas/cli/src/CLIController.js @@ -0,0 +1,16 @@ +/*global define*/ + +define(function () { + 'use strict'; + return function CLIController($scope) { + $scope.stdout = []; + $scope.stdin = ""; + + $scope.enter = function (input) { + $scope.stdin = ""; + $scope.stdout.push(""); + $scope.stdout.push(input); + $scope.stdout.push(""); + }; + }; +});