Currently, I am utilizing the controllerAs syntax in my project.
To inherit from a parent, which serves as more of a base or abstract controller, I have used $controller. I came across an insightful discussion that provided the foundation for this approach.
One interesting observation is that when using a function that references a controller property (this.propName
), it seems to access the parent's context rather than the current controller's this
. For a clear demonstration, check out this demo (plunkr).
For additional reference, here is a link to both my parent controller and child controller on GitHub Gist.