Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

esta retornando este erro ao adicionar

core.js:6479 ERROR Error: Expected validator to return Promise or Observable. at toObservable (forms.js:788) at Array.map () at FormControl.composedAsyncValidatorFn (forms.js:855) at FormControl.runAsyncValidator (forms.js:2501) at FormControl.updateValueAndValidity (forms.js:2475) at new FormControl (forms.js:2844) at FormBuilder.control (forms.js:7343) at FormBuilder.createControl (forms.js:7381) at forms.js:7367 at Array.forEach () defaultErrorLogger @ core.js:6479 handleError @ core.js:6527 (anonymous) @ core.js:29690 invoke @ zone.js:372 run @ zone.js:134 runOutsideAngular @ core.js:28571 tick @ core.js:29690 (anonymous) @ core.js:29538 invoke @ zone.js:372 onInvoke @ core.js:28672 invoke @ zone.js:371 run @ zone.js:134 run @ core.js:28526 next @ core.js:29537 __tryOrUnsub @ Subscriber.js:183 next @ Subscriber.js:122 _next @ Subscriber.js:72 next @ Subscriber.js:49 next @ Subject.js:39 emit @ core.js:25935 checkStable @ core.js:28594 onHasTask @ core.js:28689 hasTask @ zone.js:426 _updateTaskCount @ zone.js:447 _updateTaskCount @ zone.js:274 runTask @ zone.js:195 drainMicroTaskQueue @ zone.js:582 Promise.then (async) scheduleMicroTask @ zone.js:565 scheduleTask @ zone.js:396 onScheduleTask @ zone.js:283 scheduleTask @ zone.js:386 scheduleTask @ zone.js:221 scheduleMicroTask @ zone.js:241 scheduleResolveOrReject @ zone.js:1266 resolvePromise @ zone.js:1204 (anonymous) @ zone.js:1120 webpackJsonpCallback @ jsonp chunk loading:75 (anonymous) @ srcapp_home_home_module_ts.js:2 core.js:6479 ERROR Error: formGroup expects a FormGroup instance. Please pass one in.

   Example:


<div [formGroup]="myGroup">
  <input formControlName="firstName">
</div>

In your class:

this.myGroup = new FormGroup({
   firstName: new FormControl()
});
at Function.missingFormException (forms.js:1500)
at FormGroupDirective._checkFormPresent (forms.js:5529)
at FormGroupDirective.ngOnChanges (forms.js:5302)
at FormGroupDirective.rememberChangeHistoryAndInvokeOnChangesHook (core.js:1498)
at callHook (core.js:2536)
at callHooks (core.js:2495)
at executeInitAndCheckHooks (core.js:2446)
at selectIndexInternal (core.js:8447)
at Module.ɵɵadvance (core.js:8430)
at CadastroUsuarioComponent_Template (cadastro-usuario.component.html:5)



este erro é apresentado quando informo o seguinte código em : [this.usuarioExistenteService.usuarioJaExiste()]
 ngOnInit(): void {
this.novoUsuarioForm = this.formbuilder.group({
  email: ['', [Validators.required, Validators.email]],
  fullName: ['', [Validators.required, Validators.minLength(4)]],
  userName: ['',[minusculoValidator],[this.usuarioExistenteService.usuarioJaExiste()]],
  password: ['']
});
2 respostas

Estou com o mesmo erro. Conseguiu alguma resposta ?

solução!

Cara eu rosolvi o erro faz um tempo não lembro ao certo, mas acabei assistindo a aula e codando de novo, acredito que copiei algo errado, ou estava faltando um parenteses .