File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
src/core/change_detection
test/core/change_detection Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ export class ChangeDetectorRef {
2525 */
2626 detach ( ) : void { this . _cd . mode = ChangeDetectionStrategy . Detached ; }
2727
28+ detectChanges ( ) : void { this . _cd . detectChanges ( ) ; }
29+
2830 /**
2931 * Reattach the change detector to the change detector tree.
3032 *
Original file line number Diff line number Diff line change 1+ import {
2+ ddescribe ,
3+ describe ,
4+ it ,
5+ iit ,
6+ xit ,
7+ expect ,
8+ beforeEach ,
9+ afterEach ,
10+ tick ,
11+ fakeAsync
12+ } from 'angular2/test_lib' ;
13+
14+ import { ChangeDetectorRef } from 'angular2/src/core/change_detection/change_detector_ref' ;
15+ import { SpyChangeDetector } from '../spies' ;
16+
17+
18+ export function main ( ) {
19+ describe ( 'ChangeDetectorRef' , ( ) => {
20+ it ( 'should delegate detectChanges()' , ( ) => {
21+ var changeDetector = new SpyChangeDetector ( ) ;
22+ changeDetector . spy ( 'detectChanges' ) ;
23+ var changeDetectorRef = new ChangeDetectorRef ( < any > changeDetector ) ;
24+ changeDetectorRef . detectChanges ( ) ;
25+ expect ( changeDetector . spy ( 'detectChanges' ) ) . toHaveBeenCalled ( ) ;
26+ } ) ;
27+ } ) ;
28+ }
You can’t perform that action at this time.
0 commit comments