This file contains hidden or 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
| #!/bin/bash | |
| # Adicione um novo remote; pode chamá-lo de "upstream": | |
| git remote add upstream https://github.com/usuario/projeto.git | |
| # Obtenha todos os branches deste novo remote, | |
| # como o upstream/master por exemplo: | |
| git fetch upstream |
This file contains hidden or 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
| this.http | |
| .get<People>('https://swapi.co/api/people/1/') | |
| .subscribe((data: People) => { | |
| this.people = data; | |
| }); |
This file contains hidden or 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
| this.subPeople = this.http | |
| .get<People>('https://swapi.co/api/people/1/') | |
| .subscribe((data: People) => { | |
| this.people = data; | |
| }); | |
| this.subPeople.unsubscribe(); |
This file contains hidden or 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
| ngOnInit() { | |
| this.subPeople = this.http | |
| .get<People>('https://swapi.co/api/people/1/') | |
| .subscribe((data: People) => { | |
| this.people = data; | |
| }); | |
| } |
This file contains hidden or 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
| ngOnDestroy() { | |
| if (this.subPeople) { | |
| this.subPeople.unsubscribe(); | |
| } | |
| } |
This file contains hidden or 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
| @Component({ | |
| selector: 'app-example-normal', | |
| templateUrl: './example-normal.component.html', | |
| styleUrls: ['./example-normal.component.css'] | |
| }) | |
| export class ExampleNormalComponent implements OnInit, OnDestroy { | |
| people: People; | |
| planet: Planet; | |
| private subPeople: Subscription; |
This file contains hidden or 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
| import { HttpClient } from '@angular/common/http'; | |
| import { Component, OnDestroy, OnInit } from '@angular/core'; | |
| import { SubSink } from 'subsink'; | |
| import { People, Planet } from '../model/api'; | |
| @Component({ | |
| selector: 'app-example-subsink', | |
| templateUrl: './example-subsink.component.html', | |
| styleUrls: ['./example-subsink.component.css'] |
This file contains hidden or 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
| <h1>Personagem</h1> | |
| <section *ngIf="people$ | async as people"> | |
| <p>Nome: {{ people.name }}</p> | |
| <p>Nascimento: {{ people.birth_year }}</p> | |
| <p>Cor do Olho: {{ people.eye_color }}</p> | |
| </section> | |
| <br /> | |
| <h1>Planeta</h1> | |
| <section *ngIf="planet$ | async as planet"> | |
| <p>Nome: {{ planet.name }}</p> |
This file contains hidden or 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
| import { HttpClient } from '@angular/common/http'; | |
| import { Component, OnInit } from '@angular/core'; | |
| import { Observable } from 'rxjs'; | |
| import { People, Planet } from '../model/api'; | |
| @Component({ | |
| selector: 'app-example-sync', | |
| templateUrl: './example-sync.component.html', | |
| styleUrls: ['./example-sync.component.css'] |
This file contains hidden or 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
| CYAN='\033[0;36m' | |
| GREEN='\033[0;32m' | |
| # Caminho dos repositórios | |
| caminho=/home/alvaro/totvs/git | |
| # Caminho do repositório do portinari-style | |
| repositorioPortinariStyle=$caminho/portinari-style | |
| # Caminho do repositório do portinari-angular |
OlderNewer