Type notes into field. "Enter" or "Add" - to Add note to Notes.
Five notes (max) will be written to notes (newest first).
If there are more notes, the oldest note will be archived:
Notes: {{getNotes()}}
Archive: {{getArchive()}}
We use here provider, to register our services:
angular.module('notesApp', [])
.controller('NotesCtrl', function ($scope, notes, archive) { ... }
.factory('archive', function () { ... }
.factory('notes', function (archive) { ... }
Provider - is the most generic register method.