Deepak Kumar Padhy Deepak Kumar Padhy - 1 year ago 68
AngularJS Question

what is double(::) in angular js?

While going through some of the angular best practices guide I found this concept of using

before models for uni-direction binding. But it seems does not work with
field. Here is an example:

Inside expression it works as expected but inside ng-model, it's still 2-way binding. Then what's the difference?

Answer Source

An expression that starts with :: is considered a one-time expression. One-time expressions will stop recalculating once they are stable, which happens after the first digest if the expression result is a non-undefined value (see value stabilization algorithm below).

You can read more about ::

For your requirement, you can just use ng-value

Here is a sample

 <input type="text" ng-model="name">
 <input type="text" ng-value="name">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download