Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, OnInit } from '@angular/core';
- import { ProdutosService } from '../produtos.service';
- @Component({
- selector: 'app-vendas-pdv',
- templateUrl: './vendas-pdv.component.html',
- styleUrls: ['./vendas-pdv.component.css']
- })
- export class VendasPdvComponent implements OnInit {
- constructor( private ProdutosService: ProdutosService ) { }
- //Listar Produtos
- listar(){ this.ProdutosService.listar(this.dadosLoja).subscribe(dados => this.produtos = dados); }
- ngOnInit() {
- this.listar();
- }
- }
- import { Component, ViewChild, Input } from '@angular/core';
- @Component({
- selector: 'app-pdv',
- templateUrl: './pdv.component.html',
- styleUrls: ['./pdv.component.css']
- })
- export class PdvComponent {
- //IMPORTA PRODUTOS
- @Input() produtos;
- constructor() { }
- }
- <!--
- CODIGO ANTIGO FUNCIONANDO
- <app-pdv [produtos]="produtos" ></app-pdv>
- -->
- <!-- NÃO FUNCIONA -->
- <router-outlet [produtos]="produtos" ></router-outlet>
Add Comment
Please, Sign In to add comment