angular-pull-to-refresh icon indicating copy to clipboard operation
angular-pull-to-refresh copied to clipboard

Loss of inner scope

Open jdhiro opened this issue 12 years ago • 1 comments

Using the angular-pull-to-refresh directive appears to eat the scope of child elements.

For example, given:

<div class="fragment" scroll-to="{{scrollInFeed}}" on-scroll-bottom="loadMorePosts" offset="25">
    <div pull-to-refresh="loadNewPosts()">

    <!-- SECTION: New post / sign in -->
    <form class="feed-form-new" name="postForm" ng-submit="newPost()" ng-class="{expanded: inputExpand}">
        <div ng-hide="sessionState.authenticated">
            <a href="#/login" class="feed-unauth-button button">Sign in to post</a>
        </div>
        <textarea on-focus="inputExpand=true" ng-show="sessionState.authenticated" required
                  ng-model="postForm.content" class="expandable-form-textarea"
                  ng-class="{expanded: inputExpand}" placeholder="Post something"></textarea>
        <input class="expandable-form-button cancel" ng-show="inputExpand" type="button" value="Cancel" ng-click="postClear(postForm)"/>
        <input class="expandable-form-button" ng-show="inputExpand" type="submit" value="Post" />
    </form>
</div>

We are no longer able to access $scope.postForm or $scope.postForm content, they are undefined.

I don't what was a resolution for this is, but I see what looks like it might be a related discussion on $scope with ng-transclude here: https://groups.google.com/forum/#!msg/angular/az8_uNV7KyE/9YYEP8aLnnoJ

jdhiro avatar Dec 18 '13 04:12 jdhiro

I think I have the same problem here. It's not firering my "onReload" / refresh function within the scope of my controller. Any news on this?

oliverkaiser avatar Mar 23 '14 15:03 oliverkaiser