2015-05-01 17:05:19 -04:00
|
|
|
// TODO:vsavkin Use enums after switching to TypeScript
|
2015-08-17 18:28:37 -04:00
|
|
|
import {StringWrapper, normalizeBool, isBlank} from 'angular2/src/facade/lang';
|
2015-05-01 17:05:19 -04:00
|
|
|
|
2015-03-30 19:54:10 -04:00
|
|
|
/**
|
|
|
|
* CHECK_ONCE means that after calling detectChanges the mode of the change detector
|
|
|
|
* will become CHECKED.
|
|
|
|
*/
|
2015-07-23 04:03:39 -04:00
|
|
|
export const CHECK_ONCE: string = "CHECK_ONCE";
|
2015-03-30 19:54:10 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CHECKED means that the change detector should be skipped until its mode changes to
|
|
|
|
* CHECK_ONCE or CHECK_ALWAYS.
|
|
|
|
*/
|
2015-07-23 04:03:39 -04:00
|
|
|
export const CHECKED: string = "CHECKED";
|
2015-03-30 19:54:10 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CHECK_ALWAYS means that after calling detectChanges the mode of the change detector
|
|
|
|
* will remain CHECK_ALWAYS.
|
|
|
|
*/
|
2015-07-23 04:03:39 -04:00
|
|
|
export const CHECK_ALWAYS: string = "ALWAYS_CHECK";
|
2015-03-30 19:54:10 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* DETACHED means that the change detector sub tree is not a part of the main tree and
|
|
|
|
* should be skipped.
|
|
|
|
*/
|
2015-07-23 04:03:39 -04:00
|
|
|
export const DETACHED: string = "DETACHED";
|
2015-03-30 19:54:10 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ON_PUSH means that the change detector's mode will be set to CHECK_ONCE during hydration.
|
|
|
|
*/
|
2015-07-23 04:03:39 -04:00
|
|
|
export const ON_PUSH: string = "ON_PUSH";
|
2015-03-30 19:54:10 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* DEFAULT means that the change detector's mode will be set to CHECK_ALWAYS during hydration.
|
|
|
|
*/
|
2015-07-23 04:03:39 -04:00
|
|
|
export const DEFAULT: string = "DEFAULT";
|
2015-08-17 18:28:37 -04:00
|
|
|
|
|
|
|
export function isDefaultChangeDetectionStrategy(changeDetectionStrategy: string): boolean {
|
|
|
|
return isBlank(changeDetectionStrategy) || StringWrapper.equals(changeDetectionStrategy, DEFAULT);
|
|
|
|
}
|