Funcionou perfeitamente!!!  Muito obrigado!!!

Agora está ficando mais claro o fluxo de funcionamento do ANGULAR.

elementos de ENTRADA (no componente filho) => atualizações de SAÍDA (no
componente pai)

Em sex, 17 de ago de 2018 às 13:28, Pedro Cruz <[email protected]>
escreveu:

> Dá uma olhada nesse link:
> https://medium.com/@danilodev.silva/angular-5-eventemitter-aprendendo-a-usar-input-e-output-property-56df9158de6b
>
> Bruno Portela <[email protected]> escreveu no dia sexta, 17/08/2018
> à(s) 13:19:
>
>> Sou novo na área ANGULAR,tenho um formulário em Angular funcionando
>> perfeitamente.
>>
>> Resolvi criar um componente customizado para evitar replicação de
>> código.
>>
>> *Como consigo criar uma referência do componente principal dentro do
>> componente customizado?*
>>
>>
>>
>> <p-card class="ui-g-8" title="Entidade">
>> <form class="ui-g" (ngSubmit)="salvar()" #entidadeForm="ngForm">
>>
>> <div class="ui-g-4"></div>
>> <button type="submit" [disabled]="entidadeForm.form.invalid" pButton
>> label="Salvar"></button>
>>
>> <div class="ui-g-12">
>> <label for="nome">Nome:</label>
>> <input id="nome" placeholder="Nome" required type="text" size="30"
>> pInputText [(ngModel)]="entidade.nome" name="nome" #nome="ngModel">
>> <div [hidden]="nome.valid || nome.pristine" class="alert alert-danger">
>> Nome deve ser preenchido
>> </div>
>> </div>
>>
>> <div class="ui-g-12">
>> <label for="sigla">Sigla:</label>
>> <input id="sigla" placeholder="Sigla" required type="text" size="30"
>> pInputText [(ngModel)]="entidade.sigla" name="sigla" #sigla="ngModel">
>> <div [hidden]="sigla.valid || sigla.pristine" class="alert alert-danger">
>> Sigla deve ser preenchida
>> </div>
>> </div>
>>
>> <div class="ui-g-12">
>> <label for="sigla">Anexo:</label>
>>
>>
>>
>>
>>
>>
>>  <!-- GOSTARIA DE PASSAR ESSE ELEMENTO PARA DENTRO DO COMPONENTE
>> *app-component-custom* e conseguir alterar seu valor-->
>> *<input type="text" pInputText [(ngModel)]="**entidade.anexo" name="**anexo"
>> />*
>>
>>
>>
>> *<!-- ESSE É MEU COMPONENTE CUSTOMIZADO -->*
>> * <app-component-custom*
>> * name="entidade.anexo"*
>> * chaveModulo="ENTIDADE_CADASTRO" *
>> * chaveRepositorio="{{**entidade.anexo}}">*
>> * </**app-component-custom>*
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> </div>
>>
>> <div class="ui-g-12">
>> <p-checkbox label="Ativo" [(ngModel)]="entidade.ativo" binary="true" name
>> ="ativo"></p-checkbox>
>> </div>
>> </form>
>> </p-card>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Angular and AngularJS discussion" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Angular and AngularJS discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
 Bruno Portela de Moura
+55 61 9998-1808

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to