Guest User

Untitled

a guest
Oct 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import { Component, OnInit } from '@angular/core';
  2. import { ProdutosService } from '../produtos.service';
  3.  
  4. @Component({
  5. selector: 'app-vendas-pdv',
  6. templateUrl: './vendas-pdv.component.html',
  7. styleUrls: ['./vendas-pdv.component.css']
  8. })
  9. export class VendasPdvComponent implements OnInit {
  10.  
  11. constructor( private ProdutosService: ProdutosService ) { }
  12.  
  13.  
  14. //Listar Produtos
  15. listar(){ this.ProdutosService.listar(this.dadosLoja).subscribe(dados => this.produtos = dados); }
  16.  
  17. ngOnInit() {
  18. this.listar();
  19.  
  20. }
  21.  
  22. }
  23.  
  24. import { Component, ViewChild, Input } from '@angular/core';
  25.  
  26.  
  27. @Component({
  28. selector: 'app-pdv',
  29. templateUrl: './pdv.component.html',
  30. styleUrls: ['./pdv.component.css']
  31. })
  32.  
  33.  
  34. export class PdvComponent {
  35.  
  36.  
  37. //IMPORTA PRODUTOS
  38. @Input() produtos;
  39.  
  40.  
  41. constructor() { }
  42.  
  43.  
  44.  
  45. }
  46.  
  47. <!--
  48. CODIGO ANTIGO FUNCIONANDO
  49. <app-pdv [produtos]="produtos" ></app-pdv>
  50. -->
  51.  
  52.  
  53. <!-- NÃO FUNCIONA -->
  54. <router-outlet [produtos]="produtos" ></router-outlet>
Add Comment
Please, Sign In to add comment