Very good respond, i have taken out all of that and created a service to do 
Authentication. now my question still remains. here is part of my code:

<div ng-controller="defaultCtrl">
        <ng-include src="viewFile()"></ng-include>
    </div>

angular.module('app', [])
  .controller('mainCtrl', function() {

    $scope.viewFile = function(){
       if( condition A) 
             retrun viewA;
       else 
           return viewB;
    }

  });

.service('AuthService', function() {
   $http({
       get ....
        .success: function (data){
          // INVOKE viewFile() FROM CONTROLLER ABOVE?????
        }
    });
});


i want to know if there is a way that i can define viewFile in controller 
and then anfter using a service, invoke the function to do the updates. if 
not, would i be able to create viewFile() function in a service and still 
bind it to ng-inclue in my html file?




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