This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function generateArray() { | |
| 'use strict'; | |
| let length = Math.floor(Math.random() * 100000), | |
| remove = Math.floor(Math.random() * length), | |
| array = []; | |
| for (let counter = 0; counter <= length; counter += 1) { | |
| array.push(counter); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| angular.module('myApp.directives') | |
| .directive('validateClass', [function() { | |
| return { | |
| restrict: 'A', | |
| link: function validateClassLink(scope, element, attributes, ngForm) { | |
| var fieldObj = ngForm[attributes.validateClass], | |
| className = attributes.errorClass || 'has-error'; | |
| scope.$watch(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('myApp.filters', []) | |
| /** | |
| * Defines a filter on the $filter provider that will call a method | |
| * to filter objects inside of ngRepeat. | |
| * | |
| * @return {Function} | |
| * @param {Array} - the array to loop through | |
| * @param {String} - the Object method name | |
| * @param {Any} - the value to match against | |
| * @return {Array} - the resultant array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('GridController', function() { | |
| beforeEach(module('GridApp')); | |
| var GridApp, controller, scope, ctrl; | |
| beforeEach(inject(function($rootScope, $controller) { | |
| scope = $rootScope.$new(); | |
| controller = $controller; | |
| ctrl = controller('GridController', { |
NewerOlder