@drooms/ng-metadata
Version:
Angular 2 decorators and utils for Angular 1.x
83 lines • 3.16 kB
JavaScript
;
var lang_1 = require("../../facade/lang");
/**
* Describes the current state of the change detector.
*/
var ChangeDetectorState;
(function (ChangeDetectorState) {
/**
* `NeverChecked` means that the change detector has not been checked yet, and
* initialization methods should be called during detection.
*/
ChangeDetectorState[ChangeDetectorState["NeverChecked"] = 0] = "NeverChecked";
/**
* `CheckedBefore` means that the change detector has successfully completed at least
* one detection previously.
*/
ChangeDetectorState[ChangeDetectorState["CheckedBefore"] = 1] = "CheckedBefore";
/**
* `Errored` means that the change detector encountered an error checking a binding
* or calling a directive lifecycle method and is now in an inconsistent state. Change
* detectors in this state will no longer detect changes.
*/
ChangeDetectorState[ChangeDetectorState["Errored"] = 2] = "Errored";
})(ChangeDetectorState = exports.ChangeDetectorState || (exports.ChangeDetectorState = {}));
/**
* Describes within the change detector which strategy will be used the next time change
* detection is triggered.
*/
var ChangeDetectionStrategy;
(function (ChangeDetectionStrategy) {
/**
* `CheckedOnce` means that after calling detectChanges the mode of the change detector
* will become `Checked`.
*/
// CheckOnce,
/**
* `Checked` means that the change detector should be skipped until its mode changes to
* `CheckOnce`.
*/
// Checked,
/**
* `CheckAlways` means that after calling detectChanges the mode of the change detector
* will remain `CheckAlways`.
*/
// CheckAlways,
/**
* `Detached` means that the change detector sub tree is not a part of the main tree and
* should be skipped.
*/
// Detached,
/**
* `OnPush` means that the change detector's mode will be set to `CheckOnce` during hydration.
*/
ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
/**
* `Default` means that the change detector's mode will be set to `CheckAlways` during hydration.
*/
ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
})(ChangeDetectionStrategy = exports.ChangeDetectionStrategy || (exports.ChangeDetectionStrategy = {}));
/**
* List of possible {@link ChangeDetectionStrategy} values.
*/
exports.CHANGE_DETECTION_STRATEGY_VALUES = [
// ChangeDetectionStrategy.CheckOnce,
// ChangeDetectionStrategy.Checked,
// ChangeDetectionStrategy.CheckAlways,
// ChangeDetectionStrategy.Detached,
0 /* OnPush */,
1 /* Default */
];
/**
* List of possible {@link ChangeDetectorState} values.
*/
exports.CHANGE_DETECTOR_STATE_VALUES = [
0 /* NeverChecked */,
1 /* CheckedBefore */,
2 /* Errored */
];
function isDefaultChangeDetectionStrategy(changeDetectionStrategy) {
return lang_1.isBlank(changeDetectionStrategy) || changeDetectionStrategy === 1 /* Default */;
}
exports.isDefaultChangeDetectionStrategy = isDefaultChangeDetectionStrategy;
//# sourceMappingURL=constants.js.map