title: Axios and Angular
body: <p>Trying to figure out how to make an axios import and use in an Angular cli, base scaffolding.</p>
  
  <p>I didn't find any docs for this. </p>
  
  <p>I found this 
  <a href="https://netbasal.com/angular-2-use-your-own-http-library-b45e51b3525e" rel="noreferrer">https://netbasal.com/angular-2-use-your-own-http-library-b45e51b3525e</a></p>
  
  <p>what he suggests does not apply. the Cli breaks on adding any of his code bits.</p>
  
  <p>Any insight on how to do a basic post api call in Angular?</p>
  
  <p>best I got is (the angular native approach) :</p>
  
  <pre><code>import { Component } from '@angular/core';
  import { Injectable } from '@angular/core';
  import { Http } from '@angular/http';
  
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  
  @Injectable()
  export class AppComponent{
    title = 'prouuuut';
    posts = [];
    errors = [];
    constructor(private http: Http){
    }
  
    fetchAll(){
      this.http.get('https://api.github.com/repositories')
        .then(response =&gt; {
          this.posts = response.data.entry
        })
        .catch(e =&gt; {
          this.errors.push(e)
        })
    }
  }
  </code></pre>
  
  <p>inside app.component.ts but I already have :</p>
  
  <p><a href="https://i.stack.imgur.com/9EwT8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9EwT8.png" alt="enter image description here"></a></p>