angular directive example

JavaScript
/* AngularJS directives are extended HTML attributes with the prefix ng-.
*  Lets you extend HTML with new attributes
*	- The ng-app directive initializes an AngularJS application. 
*	- The ng-init directive initializes application data. 
*	- The ng-model directive binds the value of HTML controls (input, select, textarea) 
*	  to application data
*/

<div ng-app="" ng-init="firstName='Javi'">

    <p>Name: <input type="text" ng-model="firstName"></p>
    <p>You wrote: {{ firstName }}</p>

</div>
 
Source

Also in JavaScript: