Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

perf(Scope): $apply isolation #5830

Open

Description

@kseamon

Allow a new child (s) to be initialized in such a way as to limit calls to $apply made by
s and its decedents to $rootScope, s, and s's descendants.

This would be very beneficial to use-cases like dialogs where user interaction (And likely code) is isolated to a certain subtree of the page scope.

Inspiration is taken from the isolated-scope service employed by DCM which uses monkey patching to achieve this aim. It has made $apply calls in these isolated contexts substantially faster.

Activity

  1. bfricka commented on Jan 21, 2014

    @bfricka

    Just curious, do you mean that this would be a default behavior of Scope or would it by an argument passed to Scope.$new?

  2. kseamon commented on Jan 21, 2014

    @kseamon
    ContributorAuthor

    It would be a non-default option, like isolate is today.

    On Jan 21, 2014, at 3:35 AM, brian-frichette notifications@github.com wrote:

    Just curious, do you mean that this would be a default behavior of Scope or would it by an argument passed to Scope.$new?

    —
    Reply to this email directly or view it on GitHub.

  3. g00fy- commented on Jan 22, 2014

    @g00fy-

    @kseamon why not just use $digest ?

  4. kseamon commented on Jan 22, 2014

    @kseamon
    ContributorAuthor

    $digest is great when you're trying to digest the scope of your own directive. In this case, I'm talking about an isolated region of the page (It might be created by a directive, but it contains its own arbitrary markup and a controller).

    In order to accomplish this behavior with just $digest, you'd need custom implementations of ng-click, input, etc that know to digest a particular scope instead of calling $apply as they do now.

  5. added this to the milestone on Mar 27, 2014
  6. pjfsilva commented on Aug 27, 2014

    @pjfsilva

    +1 exactly because of dialog windows: my app can have multiple dialogs open at one time and they don't need to interact with anything else, so I could really improve the performance isolating them with maybe an explicit way of communication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions