Last active
October 16, 2019 08:59
-
-
Save nhamilakis/978289c0b16008029d7555e0305f11ba to your computer and use it in GitHub Desktop.
Get Stuff in Angular
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Corpus { | |
name: string; | |
} | |
@TrucAngularAUZEF | |
class MyCorporaComponent extends OnInit { | |
listCorpora : Array<Corpus> = []; | |
constructor(private api: MyAPIServiceDeLEspace){} | |
ngOninit(){ | |
// se truc se lance a chaque l'initiation du component | |
this.api.getCorpus(1).subscribe( | |
(data) => this.listCorpora = data, | |
(err) => console.log('fuck there was error : ${err}'), | |
); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@injectStuff | |
class MyAPIServiceDeLEspace { | |
constructor(http: NGHTT){} | |
getCorpus(id: string){ | |
return this.http.get('http://api/corpus/' + id ) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div *ngFor="corpora of listCorpora"> | |
<span> {{ corpora.name }} </span> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I’d just like to interject for a moment. What you’re refering to as Linux, is in fact, GNU/LInux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.