Axios and Angular | angular axios
TryingtofigureouthowtomakeanaxiosimportanduseinanAngularcli,basescaffolding.Ididntfindanydocsforthis.Ifoundthishttps://netbasal.com/angular-2-use-your-own-http-library-b45e51b3525e[1]whathesuggestsdoesnotapply.theClibreaksonaddinganyofhiscodebits.AnyinsightonhowtodoabasicpostapicallinAngular?bestIgotis(theangularnativeapproach):import{Component}from@angular/core;import{Injectable}from@angular/core;import{Http}from@angular/http;@Component({selector:app-root,templateUrl:./app.component.html,st...
Trying to figure out how to make an axios import and use in an Angular cli, base scaffolding.
I didnt find any docs for this.
I found this https://netbasal.com/angular-2-use-your-own-http-library-b45e51b3525e[1]
what he suggests does not apply. the Cli breaks on adding any of his code bits.
Any insight on how to do a basic post api call in Angular?
best I got is (the angular native approach) :
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 => { this.posts = response.data.entry }) .catch(e => { ...