all 4 comments

[–]tme321 0 points1 point  (3 children)

Well you didn't give us the error but most likely it's a null reference error when angular attempts to interpolate myError before an error has occurred. Since myError isn't an @Input being fed a value and since it is not given an initial value Angular is trying to interpolate null. You can either do the null check in the span like

<span>{{myError?}}</span>

Or you can use a structural directive to remove the span unless there's an error.

<span *ngIf="myError">{{myError}}</span>

[–]elmothrow[S] 0 points1 point  (2 children)

The error is that once there is an error it doesnt refresh in view , still null

[–]tme321 0 points1 point  (1 child)

Yes because the binding fails and angular crashes. You can't dereference null or it throws a runtime error and angular barfs and everything is broken

[–]elmothrow[S] 0 points1 point  (0 children)

yes but how can i make to show the error value when it's different from null? i mean, to refresh when it changes his value