I'm using Tim's People Tree example (http://www.nibble.be/?p=440) to get up to speed on building Sections, but I've run into an issue with part of the binding.
If I change a value in the View and save, it updates to the DB and reloads to the tree correctly. Stepping through the JS in Firefox shows that the object is being loaded in the controller, but the Input Editors in the View never update with the existing value (they stay blank).
I am not 100% sure but it may be to do with the code where you are checking if the routeParams.id is -1 if ($routeParams.id == -1)
By doing so you set the dsMenuItem object that you seem to be binding a lot of your view off is an empty object, as when you save in the function you call syncTree with a path of -1, -1 which I can assume would set the $routeParams.id to be -1
For debugging I would check & verify what $routeParams.id value is.
So perhaps add above the line $scope.loaded = false;
console.log('Route Params ID', $routeParams.id);
Hopefully this helps shed some light on the problem.
Angular Model Binding Issue
I'm using Tim's People Tree example (http://www.nibble.be/?p=440) to get up to speed on building Sections, but I've run into an issue with part of the binding.
If I change a value in the View and save, it updates to the DB and reloads to the tree correctly. Stepping through the JS in Firefox shows that the object is being loaded in the controller, but the Input Editors in the View never update with the existing value (they stay blank).
The View:
And the Controller
I'm sure this is something simple that I'm just not seeing.
Hi Robert,
I am not 100% sure but it may be to do with the code where you are checking if the routeParams.id is -1
if ($routeParams.id == -1)
By doing so you set the dsMenuItem object that you seem to be binding a lot of your view off is an empty object, as when you save in the function you call
syncTree
with a path of-1, -1
which I can assume would set the$routeParams.id
to be-1
For debugging I would check & verify what $routeParams.id value is.
So perhaps add above the line
$scope.loaded = false;
Hopefully this helps shed some light on the problem.
Cheers,
Warren
Thanks so much for taking time to look at this Warren.
I had to work on another project for a few days, and when I opened this one today everything just works.
So I'm going to chalk this up to caching, even though I had the developer tab in Firefox open, had it set to not cache, touched the web config, etc.
is working on a reply...