Jit_nodeValue_4 (...). $ any is not an Angular5 function

ERROR TypeError: jit_nodeValue_4(...).$any is not a function
at Object.eval [as handleEvent] (AddNewConnectionsComponent.html:42)
at handleEvent (core.js:13581)
at callWithDebugContext (core.js:15090)
at Object.debugHandleEvent [as handleEvent] (core.js:14677)
at dispatchEvent (core.js:9990)
at eval (core.js:10611)
at HTMLInputElement.eval (platform-browser.js:2628)
at ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:4744)
at ZoneDelegate.invokeTask (zone.js:420)

I get this error when submitting a group of forms.

My ts file code

        import { Component, OnInit } from '@angular/core';
        import { FormBuilder, Validators, FormGroup, FormControl } from '@angular/forms'
         import {ActivatedRoute, Router} from "@angular/router";

     @Component({
   selector: 'app-add-new-connections',
 templateUrl: './add-new-connections.component.html',
 styleUrls: ['./add-new-connections.component.scss']
})
export class AddNewConnectionsComponent {

 addNewConnectionForm: any;

 constructor(public fb: FormBuilder) { 
 this.addNewConnectionForm = new FormGroup({
  'connection_name': new FormControl("", [
    Validators.required
  ])
});

My html file code

<form [formGroup]="addNewConnectionForm" (ngSubmit)="saveConnection()" novalidate>
            <div class="col-sm-4"> 
<div class="form-group">
                  <label>Connection Name ?</label>
                  <input type="text" name="name" placeholder="" (change)="changeFun()" class="form-control" required>
                  <div *ngIf=>
                      Name is required.
                    </div>
                  <small [hidden]="addNewConnectionForm.controls.connection_name.valid" class="text-danger">Required</small>
              </div>
            </div>
            <button type="submit" [disabled]="!addNewConnectionForm.valid">Submit</button>
          </form>

I tried almost everything available. But I can’t find any solution. I imported FormsModule and ReactiveFormsModule into my app.module.ts file. Can you suggest me a way how I can do this.

+11
source share
3 answers

Using the command line, change to the same directory as the package.jsonapplication file that you want to update.

npm outdated, , . , ( ). npm update, npm outdated , , . , , . , , ( app.module.ts)

import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './/app-routing.module';

,

+4

.

Angular Material. , <mat-menu #share='matMenu'>. share - , , . .

+3

I get the same problem in Angular 5, and I updated the npm package on npm update, and the problem was solved for me, there was some problem in Angular dependencies, so I updated it.

0
source

Source: https://habr.com/ru/post/1692046/


All Articles