btford / angular-modal

Simple AngularJS service for creating modals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to properly test controller constructed w/ angular-modal?

chiefy opened this issue · comments

I was wondering if anyone had a good method of testing the controller that is instantiated by angular-modal's service.activate (when sending locals)? Is it best to grab the controller's scope from it's container? Just wondering what the best practices is around this?

I'd test the controller in isolation from the modal service by calling $controller yourself with the right locals (including a $scope with the right vars).

Also I've changed the behavior of activate in v0.5 to pass the locals to the controller rather than just magically assign them to the scope.

Wow thanks @btford - I saw this e-mail and was like huh? Checked it, took me a second, and I remembered. I know maintaining is not easy, but just wanted to say thanks!