Hey guys,

I am having a problem about testing my code.


angular.controller('myController', function($scope){
>     var state;
>     $scope.stateLinked;
>     $scope.getState() {
>         if(state) .... //It's undefined
>     }
>     
> });


I have this example of Controller to test. Since the stateLinked is 
attached to the $scope, I can inject the value during the test. How can I 
do to test the getState since I need the value state (that is not attached 
to the scope) to not be undefined? I need this variable to be global but 
does not make sense of being attached to scope since it's not used on View.

Thanks all,

-- 
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