title: How to pass data from asp.NET MVC to Angular2
body: <p>What is the best way to pass data from an ASP.NET MVC controller to an Angular 2.0 component? For example, we use the ASP.NET MVC Model and would like to send a JSON version of it to Angular to use it in Angular.</p>
  <p>When the controller is serving the view, we can already push some data to Angular2 (the model). So additional AJAX call to fetch that data is not required.</p>
  <p>However, I am struggling to &quot;inject&quot; it into the Angular component. How do you do this? Any good references for this? As you may have noticed, I'm quite new to Angular2.</p>
  <p>My index.cshtml looks like this.</p>
  <pre><code>&lt;div class=&quot;container&quot;&gt;
  &lt;div&gt;
      &lt;h1&gt;Welcome to the Angular 2 components!&lt;/h1&gt;
  &lt;/div&gt;
  &lt;div class=&quot;row&quot;&gt;
      &lt;MyAngular2Component&gt;
          &lt;div class=&quot;alert alert-info&quot; role=&quot;alert&quot;&gt;
              &lt;h3&gt;Loading...&lt;/h3&gt;
          &lt;/div&gt;
      &lt;/MyAngular2Component&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Kind regards,</p>
  <p>Rob</p>