Permalink
Browse files

replaced previous binding workaround by yet another workaround ;-) (a…

  • Loading branch information...
1 parent c814275 commit 4d39a66b370340eb3bd63205373f61f294eaef29 @cburgdorf committed May 8, 2012
Showing with 9 additions and 9 deletions.
  1. +6 −6 app/js/controllers.js
  2. +3 −3 app/partials/filterbox.html
View
@@ -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(){
@@ -1,9 +1,9 @@
<div class="filter-bar">
<div class="settings">
- <!--TODO ask in angular group why we can't bind the username the regular way-->
+ <!--HACK https://github.com/angular/angular.js/issues/943-->
<div class="username">
- <form ng-submit="refreshData(username)">
- <input ng-change="refreshData(username)" placeholder="Enter any github user name" type="text" ng-model="username">
+ <form ng-submit="refreshData()">
+ <input ng-change="refreshData()" placeholder="Enter any github user name" type="text" ng-model="username.value">
</form>
</div>

0 comments on commit 4d39a66

Please sign in to comment.