Skip to content

Instantly share code, notes, and snippets.

Created Sep 9, 2015
What would you like to do?
Angular 1.3 Bind Once
<!DOCTYPE html>
<meta charset="utf-8">
<title>Bind Once</title>
<script src=""></script>
<script src=""></script>
<body ng-app>
<p><input type="text" ng-model="foo"></p>
<p>ngBindHtml: <span ng-bind-html="foo"></span></p>
<p>ngBind: <span ng-bind="foo"></span></p>
<p>expression: {{foo}}</p>
<p>expression (bind once): {{::foo}}</p>
<p>ngIf: <span ng-if="foo">FOO!</span></p>
<p>ngIf (bind once): <span ng-if="::foo">FOO!</span></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment