Skip to content

AngularJS

ng-app directive is used to define AngularJS application. It designates the root element and auto-bootstraps the app. Only one AngularJS app can be auto-bootstrapped per HTML document; others must be bootstrapped manually.

Example:

<div ng-app="myApp" ng-controller="myCtrl">
First Name: <input type="text" ng-model="firstName"> <br />
Middle Name: <input type="text" ng-model="middleName"><br />
Last Name: <input type="text" ng-model="lastName"><br>
Full Name: {{firstName + " " + middleName + " " + lastName }}
</div>