Hello!

I'm currently updating our project from angular 1.0.6 to 1.3.0-rc.X and I'm 
having some issues with the digestion of ngHide/ngShow.

I couldn't reproduce it in a small fiddle, as it seems to be a situational 
problem, but I've seen it around 5 or 6 times now.

The problem is that in some cases after loading data over a $resource some 
ngHide/ngShow don't digest correctly.

For example:

<!-- TEMPLATE -->
<pre>{{someInstance.$resolved}}</pre>
<div ng-hide="someInstance.$resolved">
    <pre>{{someInstance.$resolved}}</pre>
</div>


would be parsed as:

<!-- HTML RESULT -->
<pre class="ng-binding">true</pre>
<div ng-hide="someInstance.$resolved">
    <pre class="ng-binding">true</pre>
</div>


So no *class="ng-hide"  *is applied, but the $scope variable 
*$scope.someInstance.$resolved 
*is set to true correctly (and the console isn't reporting any errors). 
Everything else (like the content of *someInstance*) is digested correctly.

This example is inside many nested directives, which are inside a view. If 
I load this view directly, it works fine, but after navigating there from 
another view, it doesn't digest right.

It's also working if I move it into a new digestion cycle like this:

scope.someInstance.$promise.then(function () {
                    scope.someInstance.$resolved = false;
                    $timeout(function () { scope.someInstance.$resolved = 
true; }, 1);
                });

But that isn't a real solution, as we use ngHide/ngShow alot.

The setup is quite complex, so I wanted to ask in general first, if a 
problem like this is known, before going in too deep. The resource is not 
an actual ngResource, it's our own resource built on top of ngResource (but 
the *$resolved* is just extended) and the resource is loaded like this in 
the link function:

scope.$watch('someOtherResource', function() {
    // ...
    scope.someResource = someOtherResource.getSomeSubResource();
    // ...
});


So is this a known bug, or am I missing something? It worked fine in 
angular 1.0.6.

Thanks for reading,
Johnny

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to