diff --git a/controller.js b/controller.js
index 9354734..2de2ccf 100644
--- a/controller.js
+++ b/controller.js
@@ -1,4 +1,4 @@
-angular.module('test', [])
+angular.module('test', ['test.directives', 'test.filters'])
.controller('testController', ['$scope', function($scope) {
}]);
\ No newline at end of file
diff --git a/directive.js b/directive.js
new file mode 100644
index 0000000..7d74784
--- /dev/null
+++ b/directive.js
@@ -0,0 +1,26 @@
+angular.module('test.directives', [])
+.directive('numbers', function() {
+ return {
+ restrict: 'E',
+ scope: {
+ from: '&',
+ to: '&',
+ filter: '&',
+ position: '&'
+ },
+ controller: ['$scope', '$filter', function($scope, $filter) {
+ $scope.numbers = function(from, to, filterName) {
+ var numbers = [];
+ for (var i = from; i <= to; i++) {
+ if (!filterName || $filter(filterName)(i)) {
+ numbers.push(i);
+ }
+ }
+ return numbers;
+ };
+ }],
+ template: '
-
-
+
+
-
+
diff --git a/styles.css b/styles.css
index 49ac741..ac876a1 100644
--- a/styles.css
+++ b/styles.css
@@ -26,4 +26,12 @@ html, body {
.buttons-holder {
float: right;
+}
+
+.pull-right {
+ float: right;
+}
+
+.pull-left {
+ float: left;
}
\ No newline at end of file
diff --git a/tests/directives/numbers.js b/tests/directives/numbers.js
new file mode 100644
index 0000000..4021618
--- /dev/null
+++ b/tests/directives/numbers.js
@@ -0,0 +1,56 @@
+describe('numbers directive test', function() {
+ var $compile,
+ $rootScope;
+
+ beforeEach(function() {
+ module('test');
+
+ module(function($provide) {
+ $provide.service('$filter', function() {
+ return function(filterName) {
+ if (filterName !== 'testFilter') return null;
+
+ return function(number) {
+ return number !== 4;
+ };
+ };
+ });
+ });
+
+ inject(function(_$compile_, _$rootScope_) {
+ $compile = _$compile_;
+ $rootScope = _$rootScope_;
+ });
+ });
+
+ it('should add the list of numbers', function() {
+ var element = $compile("