diff --git a/controller.js b/controller.js deleted file mode 100644 index 9354734..0000000 --- a/controller.js +++ /dev/null @@ -1,4 +0,0 @@ -angular.module('test', []) -.controller('testController', ['$scope', function($scope) { - -}]); \ No newline at end of file diff --git a/index.html b/index.html index 4079a43..9f0133d 100644 --- a/index.html +++ b/index.html @@ -1,33 +1,46 @@ + - - - + - -
-
-
- - -
-
- - - -
-
-
-
- - -
-
- -
- -
-
+ + + +
+
+
+ + +
+
+ + + + + +
+
+
+
+ + + + +
+
+ +
+ + + +
+ +
+ + + + + \ No newline at end of file diff --git a/angular.js b/js/angular.js similarity index 100% rename from angular.js rename to js/angular.js diff --git a/js/app.js b/js/app.js new file mode 100644 index 0000000..cc61998 --- /dev/null +++ b/js/app.js @@ -0,0 +1,4 @@ +angular.module('testApp', [ + 'controller', + 'directive' +]); diff --git a/js/controller.js b/js/controller.js new file mode 100644 index 0000000..ef66554 --- /dev/null +++ b/js/controller.js @@ -0,0 +1,29 @@ +angular.module('controller', []) + .controller('testController', ['$scope', function($scope) { + //creates an array of odd numbers between the 2 input numbers + $scope.oddArray = function() { + $scope.listValues = []; + for (var i = $scope.minValue; i <= $scope.maxValue; i++) { + if (i % 2 !== 0) { + $scope.listValues.push(i); + } + } + }; + //creates an array of Even numbers between the 2 input numbers + $scope.evenArray = function() { + $scope.listValues = []; + for (var i = $scope.minValue; i <= $scope.maxValue; i++) { + if (i % 2 === 0) { + $scope.listValues.push(i); + } + } + }; + //creates an array of numbers between the 2 input numbers + $scope.listArray = function() { + $scope.listValues = []; + for (var i = $scope.minValue; i <= $scope.maxValue; i++) { + $scope.listValues.push(i); + } + }; + + }]); \ No newline at end of file diff --git a/js/directive.js b/js/directive.js new file mode 100644 index 0000000..9df929a --- /dev/null +++ b/js/directive.js @@ -0,0 +1,8 @@ +angular.module('directive', []) + .directive('testDirective', function() { + // This directive display the values calculated in the controller functions + return { + restrict: 'EA', // E = Element, A = Attribute, C = Class, M = Comment + template: '
{{value}}

', + }; + }); \ No newline at end of file diff --git a/styles.css b/style/styles.css similarity index 100% rename from styles.css rename to style/styles.css