Using this instead of $scope would make problems writing unit tests: 
writing scenario in Jasmine I can to create new scope cutting dependencies 
that aren't interest in current test. I have studied many articles about 
"controller as ..." but found nothing about testing. Can anybody write 
short test sample where calling $http is replaced with stub? Controller and 
model are tightly connected using "this", Dependency Injection stops 
working. Is it true?

Gediminas

2013 m. gegužė 24 d., penktadienis 04:20:08 UTC+3, Ben Clinkinbeard rašė:
>
> Exposing your entire controller to your views is bad practice IMO. $scope 
> is a great way to mimic a presentation model/view model/whatever you want 
> to call it while keeping the controller itself focused on logic. Especially 
> considering the fact that exposing the whole controller was already 
> possible via $scope.ctrl = this, I really don't get why this was added. Its 
> existence will be seen by many devs as a recommendation for use. Angular is 
> great, but it's demos and docs already have a reputation for 
> encouraging/showing bad practices not appropriate for real world 
> development. This feature will only increase that perception.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to