midAngularJS
What is AngularJS ControllerAs syntax?
Updated Apr 28, 2026
Short answer
ControllerAs uses 'this' instead of $scope for cleaner code.
Deep explanation
ControllerAs syntax improves readability and avoids scope inheritance issues by binding controller instance to alias.
Real-world example
Cleaner templates using vm.name instead of $scope.name.
Common mistakes
- Mixing $scope and ControllerAs.
Follow-up questions
- Why ControllerAs?
- What is vm?