Sha256: a47dd9b329c00291cbb862013c0341599fb5a21f733397437d0af8b6f36aa516
Contents?: true
Size: 653 Bytes
Versions: 32
Compression:
Stored size: 653 Bytes
Contents
!(angular => { 'use strict'; /* Dirty Aware methods for a collection of DirtyAwareModel's */ class CollectionDirtyAwareness { constructor(models) { this._models = models; } dirtyItems() { return _.filter(this._models(), model => model.isDirty()); } isDirty() { return this.dirtyItems().length > 0; } isPristine() { return !this.isDirty(); } revert() { _.each(this._models(), model => { model.revert(); }); } } angular.module('models.collectionDirtyAwareness', []) .service('CollectionDirtyAwareness', () => CollectionDirtyAwareness); }(angular));
Version data entries
32 entries across 16 versions & 1 rubygems