Giter Club home page Giter Club logo

angular.breeze.storagewip's Introduction

angular.breeze.storageWip

Save Work in Progress to Local Storage for Angular and Breeze apps.

Coming Soon to Building Apps with Angular and Breeze on Pluralsight

Version 1.0.0

NuGet

Get Angular.Breeze.StorageWIP from NuGet

install-package Angular.Breeze.StorageWIP

##Setup // Add ngzWip to your module dependencies. var app = angular.module('app', ['ngzWip']);

zStorageConfigProvider Configuration

app.config(['zStorageConfigProvider', function (cfg) {
    cfg.config = {
        // Must set these
        key: 'YourAppName', // Identifier for the app
        wipKey: 'YourAppName.WIP', // Identifer for the app's 
        version: '1.1.0', // Your app's version 

        // These are defaulted, but can be overriden
        enabled: false, // enable Local Storage (WIP is always enabled)
        events: { // names of events that WIP will fire
            error: 'store.error',
            storeChanged: 'store.changed',
            wipChanged: 'wip.changed'
        },
        appErrorPrefix: '[ngzWip] ', // optional prefix for any error messages
        newGuid: breeze.core.getUuid // GUID function generator
    };
}]);

##API Usage

###API for zStorageWip service

// Initialize storage with a Breeze EntityManager
zStorageWip.init(entityManager)

// Clear all WIP from local storage
zStorageWip.clearAllWip()

// Store 1 entity in local storage. Pass in the wip key, entityName, and a description.
// routeState is the name of the route (after the hash) for the view where this entity may be viewed.
// routeState defaults to entityName.toLowercase() 
var key = zStorageWip.storeWipEntity(entity, key, entityName, description, routeState)

// Remove 1 entity from local storage, by its WIP key
zStorageWip.removeWipEntity(key)

// Load 1 entity into Breeze's EntityManager
// from local storage, by its WIP key
zStorageWip.loadWipEntity(key)

// Find 1 entity from local storage, by its entityName and id
var wipKey = zStorageWip.findWipKeyByEntityId(entityName, id)

// Get summary information for all WIP in local storage
var wipSummary = zStorageWip.getWipSummary()

###API for zStorage service

// Initialize storage with a Breeze EntityManager
zStorage.init(entityManager)

// Dictionary function to set if a key value is loaded 
zStorage.areItemsLoaded(key, value)
// Dictionary function to get if a key value is loaded 
var value = zStorage.areItemsLoaded(key)

// Clear all local storage, including WIP too
zStorage.clear()

// Load all of the entities form local storage 
// into Breeze's EntityManager
zStorage.load()

// Save all of the Breeze EntityManager's entities 
// to local storage
zStorage.save()

angular.breeze.storagewip's People

Contributors

johnpapa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.