Angular-Chronicle

An undo/redo library for AngularJS
3 people use it
Author: 8374985?v=2 Blitzen
Submitted by: 6452519?v=2 SamMaier

Chronicle

An undo/redo service for AngularJS. Supports user-friendly string handling, "controller as" syntax, and on event function calls.

This is tested for Angular 1.2.14+. Versions below 1.2.14 have been found to not work with Chronicle and are not officially supported.

Installation

The easiest way to install is just to use Bower.

bower install chronicle

However if you aren't using Bower, you can simply take the chronicle.js file and put it in your project and include it in your html file after you include your AngularJS source file.

Examples

Here is Chronicle's official page, and it contains a number of useful examples that cover different supported pieces of functionality.

Basic Usage

First things first, you have to start recording your variable:

$scope.str = 'test';

$scope.chronicle = Chronicle.record('str', $scope);

You then take this scope variable and call functions on it.

$scope.chronicle.undo();

$scope.chronicle.redo();

$scope.chronicle.canUndo();

$scope.chronicle.canRedo();

These functions should be self explanitory. This should be enough for basic undo/redo functionality.

Please visit the website and the GitHub repository for a more in depth overview and examples.

comments powered by Disqus
This page was last updated over 2 years ago.