title: Angular conditional templateURL
body: <p>I want to use conditional <em>templateURL</em> through attribute in my directive. here is my code : </p>
  
  <p><strong>MapMarker.js :</strong> </p>
  
  <pre><code>app.directive('mapMarker',function(){
      return {
  'app/user/ngApp/templates/libsView/templates/directives/map.html',
          templateUrl : function (elem , attrs) {
              if (attrs["mapRequire"] == "yes")
              {
                  console.info("have yes");
              }
              else
              {
  
                  console.info("doesn't have yes" , attrs["mapRequire"]);
              }
            return attrs["mapRequire"] == "yes" ?
                          'this is text' : '../templates/directives/map1.html';
          },
  </code></pre>
  
  <p><strong>HTML :</strong></p>
  
  <pre><code>&lt;map-marker mapRequire = "yes"&gt;&lt;/map-marker&gt;
  </code></pre>
  
  <p>It return  <code>doesn't have yes undefined</code> . </p>
  
  <p>Why? Any suggestion for dynamic template url depends on attribute?
  But the way , Is it the best way? </p>