ngBind directive

The ngBind directive is generally applied to a span element and replaces the content of the element with the results of the provided expression. It has the same meaning as that of the double curly markup, for example, {{expression}}.

Though alternative is available, this is used because when the page is being compiled, there is a moment when the raw state of the expressions(curly braces) is shown and it wont be a good experience to the user. Since the directive is defined by the attribute of the element, it(curly brace expressions) is invisible to the user.

The following is an example of the ngBind directive usage:
<!doctype html>
<html ng-app="parking">
<script src="angular.js"></script>
var parking = angular.module("parking", []);
parking.controller("parkingCtrl", function($scope) {
$scope.appTitle = "Parking";
<body ng-controller="parkingCtrl">
<h3 ng-bind="appTitle"></h3>
Related Tutorial
Follow Us #
Contents +