dimanche 10 juillet 2016

What happens when you do not use $destroy() after creating an instance using $new() when unit testing AngularJS

I was looking for ways to unit test AngularJs when using the "controller as vm" style. I came across this (Karma jasmine and angular controller using 'Controller as' syntax (this instead of $scope)) question.

The person who provided the answer pointed out that since the "controller as vm" pattern uses this instead of $scope that an instance of $scope must be created.

The person who answered also pointed out that since you are creating an instance that it must be destroyed.

What happens when it is not destroyed?

Aucun commentaire:

Enregistrer un commentaire