Skip to content

Commit a2e2217

Browse files
author
Jon Myrick
authored
Merge pull request CodewarsClone#27 from CodewarsClone/training
Training
2 parents d21974a + ffa4675 commit a2e2217

6 files changed

Lines changed: 37 additions & 7 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
<h2 class="font20-reg">Instructions</h2>
3+
<div>
4+
<p>These are the instructions.</p><p>Moreinfor</p>
5+
</div>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/********** INSTRUCTIONS DIRECTIVE **********/
2+
3+
angular.module('app').directive('showInstructions', function() {
4+
return {
5+
templateUrl: './components/training/instructions.html'
6+
}
7+
});

src/components/training/output.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11

2-
<div class="instructions-head">
3-
<button class="instructions-selector font13-reg-gray">Instructions</button>
4-
<button class="instructions-selector font13-reg-gray">Output</button>
5-
</div>
6-
<hr>
72
<h2 class="font20-reg">Output</h2>
83
<div>
94
<p>This is the goddamn output.</p>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/************* OUTPUT DIRECTIVE *************/
2+
13
angular.module('app').directive('showOutput', function() {
24
return {
3-
templateUrl: './output.html',
5+
templateUrl: './components/training/output.html'
46
}
57
});

src/components/training/training.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ <h2 class="font20-reg">Name of Kata</h2>
5656
</div>
5757
</div> -->
5858

59-
<div class="instructions" showOutput>
59+
<div class="instructions">
60+
<div class="instructions-head">
61+
<button class="instructions-selector font13-reg-gray" ng-click="showInstructions()">Instructions</button>
62+
<button class="instructions-selector font13-reg-gray" ng-click="showOutput()">Output</button>
63+
</div>
64+
<hr>
65+
<show-output ng-hide="showOutputShow"></show-output>
66+
<show-instructions ng-hide="showInstructionsShow"></show-instructions>
6067
</div>
6168

6269
<div class="kata-right">

src/components/training/trainingCtrl.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,22 @@ angular.module('app').controller('trainingCtrl', function($scope, $state, mainSe
66
$scope.versions = ['Node v0.10.33', 'Node v6.6.0'];
77
$scope.output = [];
88

9+
//NG-SHOWS
10+
$scope.showOutputShow = true;
11+
$scope.showInstructionsShow = false;
12+
$scope.showOutput = function() {
13+
$scope.showOutputShow = false;
14+
$scope.showInstructionsShow = true;
15+
}
16+
$scope.showInstructions = function() {
17+
$scope.showOutputShow = true;
18+
$scope.showInstructionsShow = false;
19+
}
20+
921

1022
//Examples should be an array of objects. Returned results will be an array with the different tests and their results.
1123
$scope.testExamples = function(solutions, examples) {
24+
$scope.showOutput();
1225
solutions = solutions.replace(/\n/g, " ");
1326
let examplesArr = [];
1427
examples = examples.split(/\n/);
@@ -18,6 +31,7 @@ angular.module('app').controller('trainingCtrl', function($scope, $state, mainSe
1831

1932

2033
$scope.testSuite = function(solutions) {
34+
$scope.showOutput();
2135
solutions = solutions.replace(/\n/g, " ");
2236
// mainService.testSuite(solutions, kataid).then((response) => console.log(response));
2337
}

0 commit comments

Comments
 (0)