[CLI] Receive input

This commit is contained in:
Victor Woeltjen 2015-10-08 10:55:27 -07:00
parent f1f8439726
commit e2b4c87c03
3 changed files with 28 additions and 3 deletions

View File

@ -5,6 +5,13 @@
"when": "/cli",
"templateUrl": "templates/cli.html"
}
],
"controllers": [
{
"key": "CLIController",
"implementation": "CLIController.js",
"depends": [ "$scope" ]
}
]
}
}

View File

@ -1,8 +1,10 @@
<div class="abs holder-all browse-mode">
<div class="abs holder-all browse-mode" ng-controller="CLIController">
<div class="iw-stdout">
<span ng-repeat="line in stdout">{{line}}</span>
<span ng-repeat="line in stdout track by $index">{{line}}</span>
</div>
<input type="text" class="iw-stdin" ng-model="stdin" cli-grabfocus>
<form ng-submit="enter(stdin)">
<input type="text" class="iw-stdin" ng-model="stdin" cli-grabfocus>
</form>
<mct-include key="'bottombar'"></mct-include>
</div>

View File

@ -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("");
};
};
});