F
F
Fixlix2018-01-31 14:28:50
Angular
Fixlix, 2018-01-31 14:28:50

Why is there an error when migrating from Angular 2 to Angular 5?

Hello!
Help Wanted.
When switching from Angular 2 to Angular 5, an error appeared:

ERROR TypeError: Cannot read property 'name' of undefined
    at checkBindingNoChanges (core.js:9902)
    at checkNoChangesNodeInline (core.js:13951)
    at checkNoChangesNode (core.js:13925)
    at debugCheckNoChangesNode (core.js:14754)
    at debugCheckDirectivesFn (core.js:14656)
    at Object.eval [as updateDirectives] (GeneralFormComponent.html:4)
    at Object.debugUpdateDirectives [as updateDirectives] (core.js:14638)
    at checkNoChangesView (core.js:13763)
    at callViewAction (core.js:14116)
    at execComponentViewsAction (core.js:14068)

The console refers to the line in the GeneralFormComponent as an error:
<input type="hidden" class="form-control" [(ngModel)]="model.guid" name="guid">

After debugging, I realized that the component was called 2 times. The first time the model was only initialized and the model is actually empty, and the second time the model received data from the database.
I assume that this error is being thrown precisely because some data came in and they were abruptly replaced with new ones.
Help solve the problem.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question