You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
There is a different this (inside controller method - different scope object), if method is defined in instance than if defined in prototype. And the method is invoked from child scope element (i.e. element created by repeater).
At least we should mention that in doc, as it's bit confusing.
Prototype methods are binded, so that they are always called with root (for given controller) scope as this. See https://github.com/angular/angular.js/blob/master/src/Scope.js#L583
Instance methods (defined in constructor) are only applied, so that they are called with related scope as this. (that's child scope inside repeater)
Possible solution
Unify the API - do we need to bind the prototype methods ??? I hope we don't.
User has to access parent scope through $parent or $root property.