@@ -122,8 +122,14 @@ export class ComponentBase<T> {
122122 let complexTemplates : string [ ] = Object . keys ( tempOnThis ) ;
123123 for ( let i = 0 ; i < complexTemplates . length ; i ++ ) {
124124 var compProp = getValue ( complexTemplates [ i ] , tempOnThis ) ;
125- if ( typeof compProp === 'object' && compProp . elementRef && complexTemplates [ i ] . indexOf ( '_' ) !== - 1 && complexTemplates [ i ] . indexOf ( 'Ref' ) === - 1 ) {
126- setValue ( complexTemplates [ i ] + 'Ref' , compProp , tempOnThis ) ;
125+ if ( typeof compProp === 'object' && compProp && compProp . elementRef ) {
126+ if ( typeof compProp === 'object' && compProp && compProp . elementRef && complexTemplates [ i ] . indexOf ( '_' ) !== - 1 && complexTemplates [ i ] . indexOf ( 'Ref' ) === - 1 ) {
127+ setValue ( complexTemplates [ i ] + 'Ref' , compProp , tempOnThis ) ;
128+ }
129+ if ( tempOnThis . viewContainerRef && ! getValue ( "_viewContainerRef" , compProp . elementRef . nativeElement ) && ! getValue ( "propName" , compProp . elementRef . nativeElement ) ) {
130+ setValue ( "_viewContainerRef" , tempOnThis . viewContainerRef , compProp . elementRef . nativeElement ) ;
131+ setValue ( "propName" , complexTemplates [ i ] . replace ( "Ref" , '' ) , compProp . elementRef . nativeElement ) ;
132+ }
127133 }
128134 }
129135 complexTemplates = Object . keys ( tempOnThis ) ;
@@ -184,7 +190,7 @@ export class ComponentBase<T> {
184190 // Refer Link: https://github.com/angular/angular/issues/6005
185191 setTimeout ( ( ) => {
186192 /* istanbul ignore else */
187- if ( typeof window !== 'undefined' && document . body . contains ( tempAfterViewThis . element ) || tempAfterViewThis . getModuleName ( ) === 'btn' ) {
193+ if ( typeof window !== 'undefined' && tempAfterViewThis . element || tempAfterViewThis . getModuleName ( ) . includes ( 'btn' ) ) {
188194 tempAfterViewThis . appendTo ( tempAfterViewThis . element ) ;
189195 tempAfterViewThis . ngEle . nativeElement . style . visibility = '' ;
190196 }
@@ -268,7 +274,7 @@ export class ComponentBase<T> {
268274 tempAfterContentThis . setProperties ( propObj , tagObject . instance . isInitChanges ) ;
269275 } else {
270276 /* istanbul ignore next */
271- if ( ( tempAfterContentThis [ tagObject . name ] . length !== tagObject . instance . list . length ) || ( tempAfterContentThis . getModuleName ( ) === 'diagram' ) ) {
277+ if ( ( tempAfterContentThis [ tagObject . name ] . length !== tagObject . instance . list . length ) || ( / d i a g r a m | t a b / . test ( tempAfterContentThis . getModuleName ( ) ) ) ) {
272278 tempAfterContentThis [ tagObject . name ] = tagObject . instance . list ;
273279 }
274280 for ( let list of tagObject . instance . list ) {
@@ -278,7 +284,7 @@ export class ComponentBase<T> {
278284 complexTemplates = complexTemplates . filter ( ( val : string ) : boolean => {
279285 return / R e f $ / i. test ( val ) ;
280286 } ) ;
281- if ( curChild . properties && Object . keys ( curChild . properties ) . length !== 0 && / c h a r t / . test ( tempAfterContentThis . getModuleName ( ) ) ) {
287+ if ( curChild . properties && Object . keys ( curChild . properties ) . length !== 0 ) {
282288 for ( let complexPropName of complexTemplates ) {
283289 complexPropName = complexPropName . replace ( / R e f / , '' ) ;
284290 curChild . properties [ complexPropName ] = ! curChild . properties [ complexPropName ] ?
0 commit comments