Hi there, 

the highlighted console log in the two directives below returns different 
results and I would love to know why. Its correct for the first, which is 
based on *link:* and it returns undefined for the bottom one, which 
utilized *templateUrl*: I am basically trying to return the template url 
from inside another template using the directive in the bottom. Without the 
link, the directive is not aware of the scope. I appreciate your input.
thanks.

Tariq.



angular.module('myPage')
.directive('threeAlbum',[function() { 
    return {
    scope: {'showType': '='},
      link: function (scope, elem, attr){
        console.log(scope.showType)
      return scope.showType;
      }
    };
 }]);

----------------------
angular.module('myPage')
.directive('threeAlbum',[function() { 
    return {
    scope: {'showType': '='},
      templateUrl: function (scope, elem, attr){
        console.log(scope.showType)
      return scope.showType;
      }
    };
 }]);

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