Tryit<!DOCTYPE html><html><head><title>Wikitechy AngularJS Tutorials</title><scriptsrc="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/
angular.min.js"></script></head><body><divng-app=""ng-init="myText='Welcome to Wikitechy.com'"><png-bind="myText"></p></div></body></html>
ng-bind directive declaration in AngularJS:
<divng-app=""ng-init="myText='Welcome to Wikitechy.com'"><png-bind="myText"></p></div>
Code Explanation for ng-bind directive in AngularJS:
The ng-app specifies the root element (e.g. <body> or <html>
or <div> tags) to define AngularJS application.
The ng-init is used to initialize the values for an application.(here the value Welcome to Wikitechy.com is point out for “mytext”)
The ng-bind is used to bind the AngularJS values and get the value from to the HTML Document. AngularJS will automatically update the text from the “text” variable.
Sample Output for ng-bind directive in AngularJS:
The content Welcome to Wikitechy.com is displayed in the output.