Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a new isolated scope when a module is compiled #8

Open
emanuelcostea opened this issue Jun 16, 2015 · 1 comment
Open

Create a new isolated scope when a module is compiled #8

emanuelcostea opened this issue Jun 16, 2015 · 1 comment

Comments

@emanuelcostea
Copy link
Contributor

If the module has an isolated scope then any properties that are set on the $rootScope can't be used.
To create a new scope we need to use $scope.$new(true) that returns a new $scope object. True means that is isolated and will not inherit any properties.

Docs about $new https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$new

morion4000 added a commit that referenced this issue Jun 16, 2015
@morion4000
Copy link
Contributor

@cemycc Using the newly created isolated scope on $rootScope as a fallback, however it doesn't trigger the $destroy event we need to clear subscriptions when a module is destroyed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants