title: Angular directive scope eval is undefined
body: <p>I'm using Angular in our site and am struggling to get directives working correctly. I've got a directive that's attempting to use Flash and a media player to display a video selected by dynamically building object tags and inserting a url at the correct point.</p>
  
  <p>Here's the directive</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    app.directive('movie', function() {
        var params = "&amp;autoPlay=true&amp;verbose=true&amp;plugin_AdaptiveStreamingPlugin=http://D28C.wpc.azureedge.net/80D28C/amsplayer/assets/MSAdaptiveStreamingPlugin-v1.0.13-osmf2.0.swf&amp;amp;AdaptiveStreamingPlugin_retryLive=true&amp;AdaptiveStreamingPlugin_retryInterval=10";
  
        return {
          restrict: 'E',
  
          link: function(scope, element, attrs) {
            var url = scope.$eval(attrs.src);
  
            element.replaceWith('&lt;object width="640" height="400" id="flashPlayer" ' +
              'data="http://D28C.wpc.azureedge.net/80D28C/amsplayer/assets/StrobeMediaPlayback.2.0.swf" ' +
              'type="application/x-shockwave-flash"&gt;&lt;param name="allowfullscreen" value="true"&gt; ' +
              '&lt;param name="wmode" value="direct"&gt; ' +
              '&lt;param name="flashvars" value="src=' + url + params + '"&gt;' +
              '&lt;/object&gt;');
          }
        };
      });</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here's the html</p>
  
  <pre><code> &lt;div&gt;
     &lt;movie src="vm.video.fileUri" /&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>In Chrome, when debugging, this line in the directive:</p>
  
  <pre><code>          var url = scope.$eval(attrs.src);
  </code></pre>
  
  <p>correctly contains the value <strong>vm.video.fileUri</strong> for attrs.src.
  However, when I execute that line - the value is undefined rather than the url of the video that we want to display.</p>
  
  <p>I've tried manually looking for the value by using scope.$parent.$eval in the console window - but can't find the url.  What am I doing wrong???</p>
  
  <p>I'm ending up with the word <strong>undefined</strong> with all the object parameters in the rendered html</p>
  
  <p>thanks</p>