我认为两种绑定方式是有角度的:
我可以从表单发布到控制器,如果我刷新页面,我会在页面上看到我的输入:
$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);
});
};
在 html 页面中,ng-repeater
遍历for i in input
. 但是除非我刷新页面,否则不会显示来自表单的新输入。
我很乐意为此提供帮助-谢谢!