anchor.diff:  
      Before components can be added we have to define an anchor point to mark where components can be inserted dynamically.
   
  +   광고 배너는 템플릿에서 가능한 삽입 포인트를 표시하기 위해서 `AdDirective` 라고 불리는 방향 지시어를 사용합니다. 
  +
      The ad banner uses a helper directive called `AdDirective` to mark valid insertion points in the template.
   
   +makeExample('cb-dynamic-component-loader/ts/src/app/ad.directive.ts',null,'src/app/ad.directive.ts')(format='.')
   
   :marked
  +  `AdDirective`
  +  `AdDirective`
  +
  +  `AdDirective`는 동적으로 추가 된 컴포넌트의 호스트가 될 요소의 뷰 컨테이너에 접근하기 위해 `ViewContainerRef`를 삽입합니다.
  +
     `AdDirective` injects `ViewContainerRef` to gain access to the view container of the element that will become the host of the dynamically added component.
      
   .l-main-section
   <a id="loading-components"></a>
   :marked
  +   ## 컴포넌트 로딩
      ## Loading components
   
  +   다음 단계는 광고 배너 구현입니다. 대부분의 구현은 `AdBannerComponent`에 있습니다.
  +
      The next step is to implement the ad banner. Most of the implementation is in `AdBannerComponent`.
  +
  +   우리는`template` 엘리먼트에 `AdDirective` 지시어를 추가하는 것으로 시작합니다.
   
      We start by adding a `template` element with the `AdDirective` directive applied.
   
  
positive.code: ) 
  
  :marked
    The `template` element decorated with the `ad-host` directive marks where dynamically loaded components will be added.
    
    Using a `template` element is recommended since it doesn't render any additional output.
  
  +makeExample('cb-dynamic-component-loader/ts/src/app/ad-banner.component.ts', 'ad-host' ,'src/app/ad-banner.component.ts (template)')(format='.')
  
  :marked
    ### Resolving Components
  
    `AdBanner` takes an array of `AdItem` objects as input. `AdItem` objects specify the type of component to load and any data to bind to the component.
  
    The ad components making up the ad campaign are returned from `AdService`.
    
    Passing an array of components to `AdBannerComponent` allows for a dynamic list of ads without static elements in the template. 
  
    `AdBannerComponent` cycles through the array of `AdItems` and loads the corresponding components on an interval. Every 3 seconds a new component is loaded.
  
    `ComponentFactoryResolver` is used to resolve a `ComponentFactory` for each specific component. The component factory is need to create an instance of the component.
  
    `ComponentFactories` are generated by the Angular compiler. 
    
    Generally the compiler will generate a component factory for any component referenced in a template.
    
    With dynamically loaded components there are no selector references in the templates since components are loaded at runtime. In order to ensure that the compiler will still generate a factory, dynamically loaded components have to be added to their `NgModule`'s `entryComponents` array.   
  
  +makeExample('cb-dynamic-component-loader/ts/src/app/app.module.ts', 'entry-components' ,'src/app/app.module.ts (entry components)')(format='.')
  
  :marked
    컴포넌트는 
  
    Components are added to the template by calling `createComponent` on the `ViewContainerRef` reference. 
    
    `createComponent` returns a reference to the loaded component. The component reference can be used to pass input data or call methods to interact with the component.
    광고 배너에서, 모든 컴포넌트는 `AdComponent` 인터페이스를 상속합니다.
  
    In the Ad banner, all components implement a common `AdComponent` interface to standardize the api for passing data to the components.
  
  
negative.code: ) 
  
  :marked
     결과는 아래와 같습니다:
  
     The final ad banner looks like this:
  figure.image-display
  