Skip to content

Commit b3848ad

Browse files
author
Nicholas Thomson
committed
Merge branch 'angular_refactor' of github.com:cloudspace/angular.crunchinator.com into angular_refactor
2 parents d1c2d47 + e90f39c commit b3848ad

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

app/scripts/controllers/crunchinator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ angular.module('crunchinatorApp.controllers')
2626
$scope.investors = Investor;
2727
$scope.categories = Category;
2828

29-
Company.fetch().then(function() {
29+
Company.fetch().then(function() {
3030
Company.setupDimensions();
3131
Company.runFilters(filterData);
3232
});

app/scripts/services/category.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ angular.module('crunchinatorApp.models').service('Category', function(Model, API
1414
Category.prototype.setupDimensions = function() {
1515
var crossCategories = crossfilter(this.all);
1616

17-
this.dimensions = {
17+
this.dimensions = {
1818
'byId': crossCategories.dimension(function(category) { return category.id; }),
19-
'byCompanies': crossCategories.dimension(function(category) { return category.company_ids }),
20-
'byInvestors': crossCategories.dimension(function(category) { return category.investor_ids })
19+
'byCompanies': crossCategories.dimension(function(category) { return category.company_ids; }),
20+
'byInvestors': crossCategories.dimension(function(category) { return category.investor_ids; })
2121
};
2222

23-
this.categoriesByName = crossCategories.dimension(function(category) { return category.name });
23+
this.categoriesByName = crossCategories.dimension(function(category) { return category.name; });
2424
};
2525

2626
Category.prototype.filterGroups = {
@@ -53,7 +53,7 @@ angular.module('crunchinatorApp.models').service('Category', function(Model, API
5353
return (ids.length === 0 || ids.indexOf(id) > -1);
5454
});
5555
}
56-
};
56+
};
5757

5858
return new Category();
5959
});

app/scripts/services/investor.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ angular.module('crunchinatorApp.models').service('Investor', function(Model, API
1616
Investor.prototype.setupDimensions = function() {
1717
var crossInvestors = crossfilter(this.all);
1818

19-
this.dimensions = {
19+
this.dimensions = {
2020
'byId': crossInvestors.dimension(function(investor) { return investor.id; }),
21-
'byCompanies': crossInvestors.dimension(function(investor) { return investor.invested_company_ids }),
22-
'byCategories': crossInvestors.dimension(function(investor) { return investor.invested_category_ids })
21+
'byCompanies': crossInvestors.dimension(function(investor) { return investor.invested_company_ids; }),
22+
'byCategories': crossInvestors.dimension(function(investor) { return investor.invested_category_ids; })
2323
};
2424

25-
this.investorsByName = crossInvestors.dimension(function(investor) { return investor.name });
25+
this.investorsByName = crossInvestors.dimension(function(investor) { return investor.name; });
2626
};
2727

2828
Investor.prototype.filterGroups = {
@@ -55,7 +55,7 @@ angular.module('crunchinatorApp.models').service('Investor', function(Model, API
5555
return (ids.length === 0 || ids.indexOf(id) > -1);
5656
});
5757
}
58-
};
58+
};
5959

6060
return new Investor();
6161
});

app/scripts/services/model.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ angular.module('crunchinatorApp.models').service('Model', function($rootScope, $
99
Model.prototype.fetch = function() {
1010
var self = this;
1111
var url = self.url;
12-
var parse = self.parse;
1312

1413
if (!url) { throw new Error('You must specify a url on the class'); }
1514
return $http.get(url).success(function(response) { self.all = self.parse(response); });
@@ -22,26 +21,26 @@ angular.module('crunchinatorApp.models').service('Model', function($rootScope, $
2221
Model.prototype.resetAllDimensions = function() {
2322
_.each(this.dimensions, function (dimension) {
2423
dimension.filterAll();
25-
});
24+
});
2625
};
2726

2827
Model.prototype.runFilters = function(filterData) {
2928
var self = this;
3029
this.filterData = filterData;
31-
_.each(this.filterGroups, function(filterGroupFunction, name) {
30+
_.each(this.filterGroups, function(filterGroupFunction) {
3231
filterGroupFunction.bind(self)();
3332
});
3433
};
3534

3635
Model.prototype.applyFilters = function(exclusions) {
3736
var self = this;
38-
var exclusions = exclusions || [];
37+
exclusions = exclusions || [];
3938
_.each(this.filters, function(filterFunction, filterName) {
4039
if(!_.contains(exclusions, filterName)) {
4140
filterFunction.bind(self)();
4241
}
4342
});
44-
}
43+
};
4544

4645
return new Model();
4746
});

0 commit comments

Comments
 (0)