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 factories, to register our services:
angular.module('notesApp', [])
    .controller('NotesCtrl', function ($scope, notes, archive) { ... }
    .factory('archive', function () { ... }
    .factory('notes', function (archive) { ... }
Factory is most common way to in registering objects. It is very flexible and can contain sofisticated creation logik.