What does :: mean in angularJS

Solution 1:

:: is used for one-time binding. The expression will stop recalculating once they are stable, i.e. after the first digest.

So any updates made to something will not be visible.

Solution 2:

It's used to bind model from your controller to view only. It will not update your controller model if you change this from your view. It means it's used to achieve one time binding.

Example

angular.module("myApp", []).controller('ctrl', ['$scope', function($scope) {
$scope.label = 'Some text';
}]);
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<html ng-app="myApp">
  <body ng-controller="ctrl">  
    <div>{{::label}}</div> // this will print `Some text` on load
    <div>{{label}}</div> // this will too print `Some text` on load
    <br />
    <button ng-click="label='IUpdateLabelFromHtml'">Change label</button>
  </body>
 </html>

When we change label meaning when we click on Change label link, it will update only second text i.e. binded without :: operator.

Read this for more details One way binding

Solution 3:

It means that the scope item "something" has one time binding associated to it. Thus should the item change in the controller the change will not be applied.

This is a good article on watchers and one time bindings