
p.location-badge.
  exported from <a href='../core'>angular2/core</a>
  defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/view_container_ref.ts#L10-L116">angular2/src/core/compiler/view_container_ref.ts (line 10)</a>

:markdown
  A location where <a href='ViewRef-interface.html'><code>ViewRef</code></a>s can be attached.
  
  A `ViewContainerRef` represents a location in a <a href='ViewRef-interface.html'><code>ViewRef</code></a> where other child
  <a href='ViewRef-interface.html'><code>ViewRef</code></a>s can be inserted. Adding and removing views is the only way of structurally
  changing the rendered DOM of the application.
  
  
.l-main-section
  h2 Members
  .l-sub-section
    h3#viewManager viewManager

    
    :markdown





  .l-sub-section
    h3#element element

    
    :markdown





  .l-sub-section
    h3#clear clear

    
    pre.prettyprint
      code.
        clear()
    
    :markdown
      Remove all <a href='ViewRef-interface.html'><code>ViewRef</code></a>s at current location.
      
      





  .l-sub-section
    h3#get get

    
    pre.prettyprint
      code.
        get(index: number)
    
    :markdown
      Return a <a href='ViewRef-interface.html'><code>ViewRef</code></a> at specific index.
      
      





  .l-sub-section
    h3#length length

    
    :markdown
      Returns number of <a href='ViewRef-interface.html'><code>ViewRef</code></a>s currently attached at this location.
      
      





  .l-sub-section
    h3#createEmbeddedView createEmbeddedView

    
    pre.prettyprint
      code.
        createEmbeddedView(templateRef: TemplateRef, atIndex?: number)
    
    :markdown
      Create and insert a <a href='ViewRef-interface.html'><code>ViewRef</code></a> into the view-container.
      
      - `protoViewRef` (optional) <a href='ProtoViewRef-interface.html'><code>ProtoViewRef</code></a> - The `ProtoView` to use for creating
        `View` to be inserted at this location. If `ViewContainer` is created at a location
        of inline template, then `protoViewRef` is the `ProtoView` of the template.
      - `atIndex` (optional) `number` - location of insertion point. (Or at the end if unspecified.)
      - `context` (optional) <a href='ElementRef-class.html'><code>ElementRef</code></a> - Context (for expression evaluation) from the
        <a href='ElementRef-class.html'><code>ElementRef</code></a> location. (Or current context if unspecified.)
      - `bindings` (optional) Array of <a href='ResolvedBinding-class.html'><code>ResolvedBinding</code></a> - Used for configuring
        `ElementInjector`.
      
      Returns newly created <a href='ViewRef-interface.html'><code>ViewRef</code></a>.
      
      





  .l-sub-section
    h3#createHostView createHostView

    
    pre.prettyprint
      code.
        createHostView(protoViewRef?: ProtoViewRef, atIndex?: number, dynamicallyCreatedBindings?: ResolvedBinding[])
    
    :markdown





  .l-sub-section
    h3#insert insert

    
    pre.prettyprint
      code.
        insert(viewRef: ViewRef, atIndex?: number)
    
    :markdown
      Insert a <a href='ViewRef-interface.html'><code>ViewRef</code></a> at specefic index.
      
      The index is location at which the <a href='ViewRef-interface.html'><code>ViewRef</code></a> should be attached. If omitted it is
      inserted at the end.
      
      Returns the inserted <a href='ViewRef-interface.html'><code>ViewRef</code></a>.
      
      





  .l-sub-section
    h3#indexOf indexOf

    
    pre.prettyprint
      code.
        indexOf(viewRef: ViewRef)
    
    :markdown
      Return the index of already inserted <a href='ViewRef-interface.html'><code>ViewRef</code></a>.
      
      





  .l-sub-section
    h3#remove remove

    
    pre.prettyprint
      code.
        remove(atIndex?: number)
    
    :markdown
      Remove a <a href='ViewRef-interface.html'><code>ViewRef</code></a> at specific index.
      
      If the index is omitted last <a href='ViewRef-interface.html'><code>ViewRef</code></a> is removed.
      
      





  .l-sub-section
    h3#detach detach

    
    pre.prettyprint
      code.
        detach(atIndex?: number)
    
    :markdown
      The method can be used together with insert to implement a view move, i.e.
      moving the dom nodes while the directives in the view stay intact.
      
      




