From 4d39a66b370340eb3bd63205373f61f294eaef29 Mon Sep 17 00:00:00 2001 From: Christoph Burgdorf Date: Tue, 8 May 2012 23:45:43 +0200 Subject: [PATCH] replaced previous binding workaround by yet another workaround ;-) (https://github.com/angular/angular.js/issues/943) --- app/js/controllers.js | 12 ++++++------ app/partials/filterbox.html | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index 7515c8f..ef376af 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -4,11 +4,13 @@ App.controller('StreamController',['$scope','scrollService', 'githubService' ,function ($scope, scrollService, githubService) { var currentPage = 1; - $scope.username = ""; + + //https://github.com/angular/angular.js/issues/943 + $scope.username = {value: ""}; scrollService.observe('EndReached').subscribe(function(){ currentPage++; - githubService.fetchEventStream($scope.username, currentPage) + githubService.fetchEventStream($scope.username.value, currentPage) .subscribe(function(data){ $scope.$apply(function(){ angular.forEach(data, function(value){ @@ -22,11 +24,9 @@ App.controller('StreamController',['$scope','scrollService', 'githubService' ,fu $scope.stream = []; - //TODO figure out why the binding doesn't work in the traditional way - $scope.refreshData = function(username){ - $scope.username = username; + $scope.refreshData = function(){ githubService - .fetchEventStream(username, 1) + .fetchEventStream($scope.username.value, 1) .subscribe(function(data){ if (!resetDataIfInvalid(data)){ $scope.$apply(function(){ diff --git a/app/partials/filterbox.html b/app/partials/filterbox.html index 75d23d5..b92b084 100644 --- a/app/partials/filterbox.html +++ b/app/partials/filterbox.html @@ -1,9 +1,9 @@
- +
-
- + +