* * *
Now it's time to create a real AngularJS single-page web application (SPA).
* * *
## AngularJS Application Example
You have learned enough about AngularJS to start creating your first AngularJS application:
## My Notes
Remaining characters: **100**
* * *
## Application Explanation
## AngularJS Example
My Notes
Number of characters left:
[Try it Β»](#)
Application file "myNoteApp.js":
var app = angular.module("myNoteApp", []);
Controller file "myNoteCtrl.js":
app.controller("myNoteCtrl", function($scope) {
$scope.message = "";
$scope.left = function() {return 100 - $scope.message.length;};
$scope.clear = function() {$scope.message = "";};
$scope.save = function() {alert("Note Saved");};
});
The element is the container for the AngularJS application: ng-app="**myNoteApp**":
The
is the scope for the controller in the HTML page: ng-controller="**myNoteCtrl**":