angular2
Version:
Angular 2 - a web framework for modern web apps
1 lines • 1.91 kB
Source Map (JSON)
{"version":3,"sources":["change_detector_ref.js"],"names":[],"mappings":"AAAA;AAAA,KAAO,EAAC,cAAa,CAAC,KAAO,eAAa,CAAC;AAC3C,KAAO,EAAC,UAAS;AAAG,SAAO;AAAG,aAAW,CAAC,KAAO,cAAY,CAAC;AAU9D,KAAO,MAAM,kBAAgB;AAG3B,YAAU,CAAE,EAAC,AAAe,CAAG;AAdjC,SAAK,cAAc,IAcF,eAAa,CAdQ,CAAA;AAelC,OAAG,IAAI,EAAI,GAAC,CAAC;EACf;AAAA,AAKA,aAAW,CAAE,AAAD,CAAG;AACb,OAAG,IAAI,0BAA0B,AAAC,EAAC,CAAC;EACtC;AAAA,AAOA,OAAK,CAAE,AAAD,CAAG;AACP,OAAG,IAAI,KAAK,EAAI,SAAO,CAAC;EAC1B;AAAA,AAQA,SAAO,CAAE,AAAD,CAAG;AACT,OAAG,IAAI,KAAK,EAAI,aAAW,CAAC;AAC5B,OAAG,aAAa,AAAC,EAAC,CAAC;EACrB;AAAA,AACF;AAAA,AA5CA,KAAK,eAAe,AAAC,iCACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,YAaT,cAAa,GAbmB;EAAC,CAAC,CAAC,CAAC;AA4CrD","file":"angular2/src/change_detection/change_detector_ref.es6","sourcesContent":["import {ChangeDetector} from './interfaces';\nimport {CHECK_ONCE, DETACHED, CHECK_ALWAYS} from './constants';\n\n/**\n * Controls change detection.\n *\n * {@link ChangeDetectorRef} allows requesting checks for detectors that rely on observables. It also allows detaching and\n * attaching change detector subtrees.\n *\n * @exportedAs angular2/change_detection\n */\nexport class ChangeDetectorRef {\n _cd:ChangeDetector;\n\n constructor(cd:ChangeDetector) {\n this._cd = cd;\n }\n\n /**\n * Request to check all ON_PUSH ancestors.\n */\n requestCheck() {\n this._cd.markPathToRootAsCheckOnce();\n }\n\n /**\n * Detaches the change detector from the change detector tree.\n *\n * The detached change detector will not be checked until it is reattached.\n */\n detach() {\n this._cd.mode = DETACHED;\n }\n\n /**\n * Reattach the change detector to the change detector tree.\n *\n * This also requests a check of this change detector. This reattached change detector will be checked during the\n * next change detection run.\n */\n reattach() {\n this._cd.mode = CHECK_ALWAYS;\n this.requestCheck();\n }\n}\n"]}