-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
criação da secao12 e atualização da 10 e 11
- Loading branch information
Showing
265 changed files
with
30,841 additions
and
16 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { URL_API_COMO_USAR } from './shared/app.api'; | ||
import { Enum } from './shared/enum.model'; | ||
import { Http } from '@angular/http'; | ||
import { Injectable } from '@angular/core'; | ||
|
||
@Injectable() | ||
export class ComoUsarService { | ||
|
||
constructor(private http: Http) {} | ||
|
||
public getComoUsar(): Promise<Enum[]> { | ||
return this.http.get(`${URL_API_COMO_USAR}`) | ||
.toPromise() | ||
.then((resposta: any) => resposta.json()); | ||
} | ||
|
||
public getComoUsarOfertaPorId(id: string): Promise<string> { | ||
return this.http.get(`${URL_API_COMO_USAR}?id=${id}`) | ||
.toPromise() | ||
.then((resposta: any) => resposta.json()[0].descricao); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<p>como-usar works!</p> | ||
<p>{{descricao}}</p> |
10 changes: 8 additions & 2 deletions
10
secao10/app2/src/app/oferta/como-usar/como-usar.component.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import { ComoUsarService } from './../../como-usar.service'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-como-usar', | ||
templateUrl: './como-usar.component.html', | ||
styleUrls: ['./como-usar.component.css'] | ||
styleUrls: ['./como-usar.component.css'], | ||
providers: [ComoUsarService] | ||
}) | ||
export class ComoUsarComponent implements OnInit { | ||
|
||
constructor() { } | ||
public descricao: string; | ||
|
||
constructor(private route: ActivatedRoute, private comoUsarService: ComoUsarService) { } | ||
|
||
ngOnInit(): void { | ||
this.comoUsarService.getComoUsarOfertaPorId(this.route.parent.snapshot.params.id).then(descricao => this.descricao = descricao); | ||
} | ||
|
||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<p>onde-fica works!</p> | ||
<p>{{descricao}}</p> |
14 changes: 11 additions & 3 deletions
14
secao10/app2/src/app/oferta/onde-fica/onde-fica.component.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { OndeFicaService } from 'src/app/onde-fica.service'; | ||
|
||
@Component({ | ||
selector: 'app-onde-fica', | ||
templateUrl: './onde-fica.component.html', | ||
styleUrls: ['./onde-fica.component.css'] | ||
styleUrls: ['./onde-fica.component.css'], | ||
providers: [OndeFicaService] | ||
}) | ||
export class OndeFicaComponent implements OnInit { | ||
|
||
constructor() { } | ||
public descricao: string; | ||
|
||
constructor(private route: ActivatedRoute, private ondeFicaService: OndeFicaService) { } | ||
|
||
ngOnInit(): void { | ||
console.log('aaaa: ' + this.route.parent.snapshot.params.id); | ||
console.log('bbbb: ' + this.route.snapshot.params.id); | ||
this.ondeFicaService.getOndeFicaPorId(this.route.parent.snapshot.params.id).then( | ||
descricao => this.descricao = descricao); | ||
} | ||
|
||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { URL_API_ONDE_FICA, URL_API_COMO_USAR } from './shared/app.api'; | ||
import { Enum } from './shared/enum.model'; | ||
import { Http } from '@angular/http'; | ||
import { Injectable } from '@angular/core'; | ||
|
||
@Injectable() | ||
export class OndeFicaService { | ||
|
||
constructor(private http: Http) {} | ||
|
||
public getOndeFica(): Promise<Enum[]> { | ||
return this.http.get(`${URL_API_ONDE_FICA}`) | ||
.toPromise() | ||
.then((resposta: any) => resposta.json()); | ||
} | ||
|
||
public getOndeFicaPorId(id: string): Promise<string> { | ||
return this.http.get(`${URL_API_ONDE_FICA}?id=${id}`) | ||
.toPromise() | ||
.then((resposta: any) => resposta.json()[0].descricao); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export const URL_API = 'http://localhost:3000/ofertas'; | ||
export const URL_API_OFERTAS = 'http://localhost:3000/ofertas'; | ||
export const URL_API_COMO_USAR = 'http://localhost:3000/como-usar'; | ||
export const URL_API_ONDE_FICA = 'http://localhost:3000/onde-fica'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export class Enum { | ||
private id: number; | ||
private descricao: string; | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"git.ignoreLimitWarning": true | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Editor configuration, see https://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.ts] | ||
quote_type = single | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# compiled output | ||
/dist | ||
/tmp | ||
/out-tsc | ||
# Only exists if Bazel was run | ||
/bazel-out | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# profiling files | ||
chrome-profiler-events*.json | ||
speed-measure-plugin*.json | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history/* | ||
|
||
# misc | ||
/.sass-cache | ||
/connect.lock | ||
/coverage | ||
/libpeerconnection.log | ||
npm-debug.log | ||
yarn-error.log | ||
testem.log | ||
/typings | ||
|
||
# System Files | ||
.DS_Store | ||
Thumbs.db |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# App2 | ||
|
||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.6. | ||
|
||
## Development server | ||
|
||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. | ||
|
||
## Code scaffolding | ||
|
||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. | ||
|
||
## Build | ||
|
||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. | ||
|
||
## Running unit tests | ||
|
||
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
|
||
## Running end-to-end tests | ||
|
||
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). | ||
|
||
## Further help | ||
|
||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). |
Oops, something went wrong.