‘Controller as’ or ...
 
Notifications
Clear all

‘Controller as’ or ‘$scope’ in AngularJS


Djones
Posts: 7
Topic starter
(@djones)
Active Member
Joined: 1 year ago

I am use to $scope in AngularJS controller. 

The project I am contracting on use ‘Controller as’ and I don’t see why. 

What’s the proper way out there apart from moving to latest Angular 8 🙂

Reply
2 Replies
Codr
Posts: 4
 Codr
(@codr)
New Member
Joined: 1 year ago

I have seen both... personally prefer Controller as  

Try to avoid directly using $scope variables in the view.

Reply
1 Reply
Djones
(@djones)
Joined: 1 year ago

Active Member
Posts: 7

@codr Thanks!

Reply