diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-26 19:30:27 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-26 19:30:27 +0100 |
commit | f7c819938067fb6a81822f26943a5c136643a1f7 (patch) | |
tree | aa6663df5cce7a7bbb46aad728df033706d88991 /js | |
parent | eff408710b708a44cf3869599985fd8246c0400b (diff) |
viewing the first 20 items is now possible
Diffstat (limited to 'js')
-rw-r--r-- | js/app/controllers/itemcontroller.coffee | 2 | ||||
-rw-r--r-- | js/public/app.js | 3 | ||||
-rw-r--r-- | js/tests/controllers/itemcontrollerSpec.coffee | 16 |
3 files changed, 18 insertions, 3 deletions
diff --git a/js/app/controllers/itemcontroller.coffee b/js/app/controllers/itemcontroller.coffee index 163d652ca..c23d84e14 100644 --- a/js/app/controllers/itemcontroller.coffee +++ b/js/app/controllers/itemcontroller.coffee @@ -27,6 +27,8 @@ angular.module('News').factory '_ItemController', -> constructor: (@$scope, @itemModel, @feedLoading) -> + @$scope.items = @itemModel.getAll() + @$scope.isLoading = => return @feedLoading.isLoading() diff --git a/js/public/app.js b/js/public/app.js index eade23a4e..766317fd5 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -209,8 +209,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. this.$scope.folders = this._folderModel.getAll(); this.$scope.feedType = this._feedType; this.$scope.isFeedActive = function(type, id) { - console.log(type + ' ' + id); - console.log(_this.isFeedActive(type, id)); return _this.isFeedActive(type, id); }; this.$scope.isShown = function(type, id) { @@ -482,6 +480,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. this.$scope = $scope; this.itemModel = itemModel; this.feedLoading = feedLoading; + this.$scope.items = this.itemModel.getAll(); this.$scope.isLoading = function() { return _this.feedLoading.isLoading(); }; diff --git a/js/tests/controllers/itemcontrollerSpec.coffee b/js/tests/controllers/itemcontrollerSpec.coffee index 32d6651a7..02682214f 100644 --- a/js/tests/controllers/itemcontrollerSpec.coffee +++ b/js/tests/controllers/itemcontrollerSpec.coffee @@ -24,4 +24,18 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. describe '_ItemController', -> - beforeEach module 'News'
\ No newline at end of file + beforeEach module 'News' + + beforeEach inject (@_ItemController, @ActiveFeed, @ShowAll, @FeedType, + @StarredCount, @FeedModel, @FolderModel, @ItemModel) => + @scope = {} + @persistence = { + getItems: -> + } + @controller = new @_ItemController(@scope, @ItemModel) + + it 'should make items availabe', => + @ItemModel.getAll = jasmine.createSpy('ItemModel') + new @_ItemController(@scope, @ItemModel) + + expect(@ItemModel.getAll).toHaveBeenCalled() |