11import {
2- Component , Host , HostBinding , Inject , Input , OnDestroy , OnInit ,
2+ Component ,
3+ forwardRef , Host , HostBinding , Inject , Input , OnDestroy , OnInit ,
34 Optional , QueryList , SkipSelf , ViewChildren , ViewEncapsulation
45} from '@angular/core' ;
56import { expandCollapse , expandCollapseForDomDestroy } from 'ng-devui/utils' ;
@@ -17,31 +18,11 @@ import { AccordionMenuItem } from './accordion.type';
1718 preserveWhitespaces : false ,
1819 providers : [ {
1920 provide : ACCORDION_LIST ,
20- useExisting : AccordionListComponent
21+ useExisting : forwardRef ( ( ) => AccordionListComponent )
2122 } ]
2223} )
2324export class AccordionListComponent implements OnInit , OnDestroy {
2425
25- // @HostBinding ('class.open')
26- // get open() {
27- // return (this.keyOpen === undefined && this.accordion.autoOpenActiveMenu)
28- // ? this.childActived
29- // : this.keyOpen;
30- // }
31- // get keyOpen() {
32- // return this.data && this.data[this.accordion.openKey];
33- // }
34-
35- // get children() {
36- // return this.data && this.data[this.accordion.childrenKey];
37- // }
38- // get childActived() {
39- // return this.routerLinkActived || this.hasActiveChildren;
40- // }
41-
42- // get showAnimate() {
43- // return this.accordion.showAnimation;
44- // }
4526 constructor ( @Optional ( ) @Host ( ) @SkipSelf ( ) @Inject ( ACCORDION_MENU ) private parentComponent : any ,
4627 @Inject ( ACCORDION ) private accordion : any ) { }
4728 @HostBinding ( 'class.devui-accordion-show-animate' ) get animateState ( ) {
@@ -113,7 +94,7 @@ export class AccordionListComponent implements OnInit, OnDestroy {
11394 @Input ( ) parent : AccordionMenuItem ;
11495 @ViewChildren ( ACCORDION_MENU ) accordionMenuQueryList : QueryList < any > ;
11596 @ViewChildren ( AccordionItemRouterlinkComponent ) accordionItemRouterlinkQueryList : QueryList < AccordionItemRouterlinkComponent > ;
116- 6 ;
97+ 6 ;
11798 ngOnInit ( ) : void {
11899 if ( this . parentComponent ) {
119100 setTimeout ( ( ) => { this . parentComponent . accordionListFromView = this ; } ) ;
0 commit comments