2015-02-05 13:08:05 -08:00
|
|
|
import {List} from 'angular2/src/facade/collection';
|
2015-03-11 21:11:39 -07:00
|
|
|
import {Locals} from './parser/locals';
|
2015-04-01 15:49:14 -07:00
|
|
|
import {DEFAULT} from './constants';
|
2015-04-09 07:57:33 -07:00
|
|
|
import {BindingRecord} from './binding_record';
|
2015-03-30 16:54:10 -07:00
|
|
|
|
|
|
|
export class ProtoChangeDetector {
|
2015-04-30 14:45:42 -07:00
|
|
|
instantiate(dispatcher:any):ChangeDetector{
|
2015-03-30 16:54:10 -07:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-13 21:00:52 -07:00
|
|
|
/**
|
|
|
|
* Interface used by Angular to control the change detection strategy for an application.
|
|
|
|
*
|
|
|
|
* Angular implements the following change detection strategies by default:
|
|
|
|
*
|
2015-04-17 13:01:07 -07:00
|
|
|
* - {@link DynamicChangeDetection}: slower, but does not require `eval()`.
|
|
|
|
* - {@link JitChangeDetection}: faster, but requires `eval()`.
|
2015-04-13 21:00:52 -07:00
|
|
|
*
|
2015-04-17 13:01:07 -07:00
|
|
|
* In JavaScript, you should always use `JitChangeDetection`, unless you are in an environment that has
|
2015-04-13 21:00:52 -07:00
|
|
|
* [CSP](https://developer.mozilla.org/en-US/docs/Web/Security/CSP), such as a Chrome Extension.
|
|
|
|
*
|
2015-04-17 13:01:07 -07:00
|
|
|
* In Dart, use `DynamicChangeDetection` during development. The Angular transformer generates an analog to the
|
|
|
|
* `JitChangeDetection` strategy at compile time.
|
2015-04-13 21:00:52 -07:00
|
|
|
*
|
|
|
|
*
|
2015-04-17 13:01:07 -07:00
|
|
|
* See: {@link DynamicChangeDetection}, {@link JitChangeDetection}
|
2015-04-13 21:00:52 -07:00
|
|
|
*
|
|
|
|
* # Example
|
|
|
|
* ```javascript
|
2015-04-27 15:30:47 -07:00
|
|
|
* bootstrap(MyApp, [bind(ChangeDetection).toClass(DynamicChangeDetection)]);
|
2015-04-13 21:00:52 -07:00
|
|
|
* ```
|
|
|
|
* @exportedAs angular2/change_detection
|
|
|
|
*/
|
2015-03-30 16:54:10 -07:00
|
|
|
export class ChangeDetection {
|
2015-04-30 14:45:42 -07:00
|
|
|
createProtoChangeDetector(name:string, bindingRecords:List, variableBindings:List, directiveRecords:List,
|
|
|
|
changeControlStrategy:string=DEFAULT):ProtoChangeDetector{
|
2015-03-30 16:54:10 -07:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
2015-01-14 13:51:16 -08:00
|
|
|
|
|
|
|
export class ChangeDispatcher {
|
2015-04-09 07:57:33 -07:00
|
|
|
notifyOnBinding(bindingRecord:BindingRecord, value:any) {}
|
2015-01-14 13:51:16 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
export class ChangeDetector {
|
|
|
|
parent:ChangeDetector;
|
2015-02-01 12:09:35 -08:00
|
|
|
mode:string;
|
2015-01-14 13:51:16 -08:00
|
|
|
|
|
|
|
addChild(cd:ChangeDetector) {}
|
2015-04-09 07:29:32 -07:00
|
|
|
addShadowDomChild(cd:ChangeDetector) {}
|
2015-01-14 13:51:16 -08:00
|
|
|
removeChild(cd:ChangeDetector) {}
|
2015-04-14 18:01:44 -07:00
|
|
|
removeShadowDomChild(cd:ChangeDetector) {}
|
2015-01-14 13:51:16 -08:00
|
|
|
remove() {}
|
2015-04-01 15:49:14 -07:00
|
|
|
hydrate(context:any, locals:Locals, directives:any) {}
|
2015-02-27 07:56:50 -08:00
|
|
|
dehydrate() {}
|
2015-02-02 17:40:54 -08:00
|
|
|
markPathToRootAsCheckOnce() {}
|
2015-01-14 13:51:16 -08:00
|
|
|
|
|
|
|
detectChanges() {}
|
|
|
|
checkNoChanges() {}
|
|
|
|
}
|