1- import { Component , View , Directive , ElementRef , Renderer , EventEmitter , DynamicComponentLoader , Host , ViewEncapsulation , Type , ComponentRef , KeyValueDiffer , KeyValueDiffers , OnInit , DoCheck } from 'angular2/core' ;
1+ import { Component , View , Directive , ElementRef , Renderer , EventEmitter , DynamicComponentLoader , Host , ViewEncapsulation , Type , ComponentRef , KeyValueDiffer , KeyValueDiffers , OnInit , OnDestroy , DoCheck } from 'angular2/core' ;
22
33@Directive ( {
44 selector : '[ngGrid]' ,
@@ -372,8 +372,8 @@ export class NgGrid implements OnInit, DoCheck {
372372 this . _createPlaceholder ( item . getGridPosition ( ) , item . getSize ( ) ) ;
373373 this . isResizing = true ;
374374
375- this . resizeStart . next ( item ) ;
376- item . resizeStart . next ( item . getDimensions ( ) ) ;
375+ this . resizeStart . emit ( item ) ;
376+ item . resizeStart . emit ( item . getDimensions ( ) ) ;
377377 }
378378 }
379379
@@ -391,8 +391,8 @@ export class NgGrid implements OnInit, DoCheck {
391391 this . _createPlaceholder ( item . getGridPosition ( ) , item . getSize ( ) ) ;
392392 this . isDragging = true ;
393393
394- this . dragStart . next ( item ) ;
395- item . dragStart . next ( item . getPosition ( ) ) ;
394+ this . dragStart . emit ( item ) ;
395+ item . dragStart . emit ( item . getPosition ( ) ) ;
396396 }
397397 }
398398
@@ -444,8 +444,8 @@ export class NgGrid implements OnInit, DoCheck {
444444 this . _draggingItem . setPosition ( newL , newT ) ;
445445 }
446446
447- this . drag . next ( this . _draggingItem ) ;
448- this . _draggingItem . drag . next ( this . _draggingItem . getPosition ( ) ) ;
447+ this . drag . emit ( this . _draggingItem ) ;
448+ this . _draggingItem . drag . emit ( this . _draggingItem . getPosition ( ) ) ;
449449 }
450450 }
451451
@@ -490,8 +490,8 @@ export class NgGrid implements OnInit, DoCheck {
490490 if ( this . _resizeDirection == 'height' ) bigGrid . x = iGridPos . col + itemSize . x ;
491491 if ( this . _resizeDirection == 'width' ) bigGrid . y = iGridPos . row + itemSize . y ;
492492
493- this . resize . next ( this . _resizingItem ) ;
494- this . _resizingItem . resize . next ( this . _resizingItem . getDimensions ( ) ) ;
493+ this . resize . emit ( this . _resizingItem ) ;
494+ this . _resizingItem . resize . emit ( this . _resizingItem . getDimensions ( ) ) ;
495495 }
496496 }
497497
@@ -519,8 +519,8 @@ export class NgGrid implements OnInit, DoCheck {
519519 this . _cascadeGrid ( ) ;
520520
521521 this . _draggingItem . stopMoving ( ) ;
522- this . _draggingItem . dragStop . next ( this . _draggingItem . getPosition ) ;
523- this . dragStop . next ( this . _draggingItem ) ;
522+ this . _draggingItem . dragStop . emit ( this . _draggingItem . getPosition ) ;
523+ this . dragStop . emit ( this . _draggingItem ) ;
524524 this . _draggingItem = null ;
525525 this . _posOffset = null ;
526526 this . _placeholderRef . dispose ( ) ;
@@ -539,8 +539,8 @@ export class NgGrid implements OnInit, DoCheck {
539539 this . _cascadeGrid ( ) ;
540540
541541 this . _resizingItem . stopMoving ( ) ;
542- this . _resizingItem . resizeStop . next ( this . _resizingItem . getDimensions ( ) ) ;
543- this . resizeStop . next ( this . _resizingItem ) ;
542+ this . _resizingItem . resizeStop . emit ( this . _resizingItem . getDimensions ( ) ) ;
543+ this . resizeStop . emit ( this . _resizingItem ) ;
544544 this . _resizingItem = null ;
545545 this . _resizeDirection = null ;
546546 this . _placeholderRef . dispose ( ) ;
@@ -909,7 +909,7 @@ export class NgGrid implements OnInit, DoCheck {
909909 inputs : [ 'config: ngGridItem' , 'gridPosition: ngGridPosition' , 'gridSize: ngGridSize' ] ,
910910 outputs : [ 'itemChange' , 'dragStart' , 'drag' , 'dragStop' , 'resizeStart' , 'resize' , 'resizeStop' ]
911911} )
912- export class NgGridItem implements OnInit {
912+ export class NgGridItem implements OnInit , OnDestroy {
913913 // Event Emitters
914914 public itemChange : EventEmitter < any > = new EventEmitter ( ) ;
915915 public dragStart : EventEmitter < any > = new EventEmitter ( ) ;
@@ -1044,7 +1044,7 @@ export class NgGridItem implements OnInit {
10441044 }
10451045 }
10461046
1047- public onDestroy ( ) : void {
1047+ public ngOnDestroy ( ) : void {
10481048 if ( this . _added ) this . _ngGrid . removeItem ( this ) ;
10491049 }
10501050
@@ -1100,7 +1100,7 @@ export class NgGridItem implements OnInit {
11001100 this . gridSize = { 'x' : this . _sizex , 'y' : this . _sizey } ;
11011101 this . _recalculateDimensions ( ) ;
11021102
1103- this . itemChange . next ( { 'col' : this . _col , 'row' : this . _row , 'sizex' : this . _sizex , 'sizey' : this . _sizey } ) ;
1103+ this . itemChange . emit ( { 'col' : this . _col , 'row' : this . _row , 'sizex' : this . _sizex , 'sizey' : this . _sizey } ) ;
11041104 }
11051105
11061106 public setGridPosition ( col : number , row : number ) : void {
@@ -1110,7 +1110,7 @@ export class NgGridItem implements OnInit {
11101110
11111111 this . _recalculatePosition ( ) ;
11121112
1113- this . itemChange . next ( { 'col' : this . _col , 'row' : this . _row , 'sizex' : this . _sizex , 'sizey' : this . _sizey } ) ;
1113+ this . itemChange . emit ( { 'col' : this . _col , 'row' : this . _row , 'sizex' : this . _sizex , 'sizey' : this . _sizey } ) ;
11141114 }
11151115
11161116 public setPosition ( x : number , y : number ) : void {
0 commit comments