SoFunction
Updated on 2025-04-04

Solve the problem that angular two-way binding has no effect and ng-model cannot display normally

I encountered a problem today. The variables in the js code have changed, but the html page is not displayed normally.

The code is as follows:

<input type="text" ng-model="paramValue" auto-focus>

$ = param;

The above code will cause sometimes there is no content in the input box. The breakpoint shows that $ has a value, but the page just cannot display anything.

It's fine to change to the following code:

<input type="text" ng-model="" auto-focus>

$ = param;

This bug is rarely encountered. This is the first time I have encountered it in recent years. Let’s record it.

The above article solves the problem that angular two-way binding has no effect and ng-model cannot be displayed normally is all the content I share with you. I hope you can give you a reference and I hope you can support me more.