- AngularJS provides ngNonBindable directive to create non bindable expression.
- In this demo,”We will see an example of non bindable AngularJS expression”.
- Below code used the ngNonBindable directive to unbind the expression.
<!DOCTYPE html> <html ng-app="myApp"> <head> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script> <meta charset="utf-8"> <title>AngularJS ngNonBindable Example</title> </head> <body ng-controller="MyController"> <h3>Use of ngNonBindable Directive Example</h3> <h5>Default binding {{number1+number2}}</h5> <h5 ng-non-bindable>No binding {{number1+number2}}</h5> <script> var myApp = angular.module("myApp", []); myApp.controller("MyController", ["$scope", function($scope) { $scope.number1 = 1; $scope.number2 = 5; }]); </script> </body> </html>
- The output of the above code is embedded in below JSBIN link.