title: Declarative creation of an Overlay with ScrollStrategy
body: <p><strong>TL,DR</strong>; How can a <a href="https://material.angular.io/cdk/overlay/api#ScrollStrategyOptions" rel="nofollow noreferrer">scroll strategy</a> be used when creating a <a href="https://material.angular.io/cdk/overlay/api#CdkConnectedOverlay" rel="nofollow noreferrer">CdkConnectedOverlay</a> declaratively?</p>
  
  <p><strong>Detail</strong>; <a href="https://material.angular.io/cdk/overlay/api#CdkConnectedOverlay" rel="nofollow noreferrer">CdkConnectedOverlay</a> is a Directive to facilitate declarative creation of an Overlay.</p>
  
  <p>It provides <a href="https://material.angular.io/cdk/overlay/api#CdkConnectedOverlay" rel="nofollow noreferrer">numerous</a> <code>@Input()</code> properties, most of which are intuitive. For example:</p>
  
  <pre><code>&lt;ng-template cdkConnectedOverlay
               cdkConnectedOverlayOpen="true"
               cdkConnectedOverlayOffsetX="0"
               cdkConnectedOverlayOffsetY="0"&gt;
  
      &lt;span&gt;I'm an overlay&lt;/span&gt;
  &lt;/ng-template&gt;
  </code></pre>
  
  <p>One property defines a <a href="https://material.angular.io/cdk/overlay/api#ScrollStrategyOptions" rel="nofollow noreferrer">scroll strategy</a>:</p>
  
  <pre><code>@Input('cdkConnectedOverlayScrollStrategy')
  scrollStrategy: ScrollStrategy
  </code></pre>
  
  <blockquote>
    <p>Strategy to be used when handling scroll events while the overlay is
    open.</p>
  </blockquote>
  
  <p>However it's not clear how to define a scroll strategy when creating an overlay declaratively.</p>
  
  <p>The source code (<a href="https://github.com/angular/material2/blob/master/src/cdk/overlay/overlay-directives.ts#L166" rel="nofollow noreferrer">material2/src/cdk/overlay/overlay-directives.ts</a>) provides a little insight:</p>
  
  <pre><code>  /** Strategy to be used when handling scroll events while the overlay is open. */
    @Input('cdkConnectedOverlayScrollStrategy') scrollStrategy: ScrollStrategy =
        this._scrollStrategy();
  </code></pre>
  
  <p>Clearly, a strategy can be provided, but unlike other properties, it's assigned a value of <code>this._scrollStrategy();</code>.</p>