File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 20
20
},
21
21
"homepage" : " https://github.com/ksachdeva/angular2-swing#readme" ,
22
22
"dependencies" : {
23
- "swing" : " ^4.3.0 "
23
+ "swing" : " ^3.1.1 "
24
24
},
25
25
"devDependencies" : {
26
26
"@angular/common" : " ^4.0.0" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import {Card} from './swing';
11
11
export class SwingCardComponent {
12
12
@Input ( ) prepend : boolean = false ;
13
13
14
+ card : Card ;
15
+
14
16
constructor (
15
17
private elmentRef : ElementRef ,
16
18
private swingStack : SwingStackComponent ) {
@@ -31,4 +33,10 @@ export class SwingCardComponent {
31
33
getCard ( ) : Card {
32
34
return this . swingStack . stack . getCard ( this . getNativeElement ( ) ) ;
33
35
}
36
+
37
+ destroyCard ( ) {
38
+ this . swingStack . cards = this . swingStack . cards . filter ( swingCardComponent => swingCardComponent !== this ) ;
39
+ let card = this . swingStack . stack . getCard ( this . getNativeElement ( ) ) ;
40
+ this . swingStack . stack . destroyCard ( card ) ;
41
+ }
34
42
}
Original file line number Diff line number Diff line change @@ -93,6 +93,12 @@ export interface Stack {
93
93
*/
94
94
getCard ( element : HTMLElement ) : Card ;
95
95
96
+ /**
97
+ *
98
+ *@param {Card } card
99
+ */
100
+ destroyCard ( card : Card ) : void ;
101
+
96
102
on ( eventName : ThrowEventName , callabck : ( event : ThrowEvent ) => void ) : void ;
97
103
on ( eventName : DragEventName , callabck : ( event : DragEvent ) => void ) : void ;
98
104
}
You can’t perform that action at this time.
0 commit comments