When running in a SharePoint Hosted App you can easily receive the FormDigestValue by executing
ShareCoffee.Commons.getFormDigest() which is very easy.
But if you’re executing queries from a plain HTML page sitting in your SharePoint hosted App - or in the case you’re running in an Office App - you can ask for a
FormDigestValue using ShareCoffee’s REST interface. The following sample code shows how to receive the
FormDigestValue from within a plain HTML Page using AngularJS.
In the case you’re writing your App in CoffeeScript (which is awesome :D) the code looks like the following