I always thought two-way binding was just an Angular thing:
When I submit a form to the controller, my input is displayed on the page. However, I have to refresh the page to see the new input:
$scope.loadInput = function () {
$scope.me.getList('api') //Restangular - this part works
.then(function(userinput) {
$scope.Input = $scope.Input.concat(userinput);
// scope.input is being referenced by ng-repeater in the page
// so after here a refresh should be triggered.
},function(response){
/*@alon TODO: better error handling than console.log..*/
console.log('Error with response:', response.status);
});
};
The HTML page uses ng-repeater
to loop through the array with for i in input
, but the new input from the form is only displayed after refreshing the page.
I would appreciate any help with this issue - thank you!