@@ -122,8 +122,14 @@ export class ComponentBase<T> {
122
122
let complexTemplates : string [ ] = Object . keys ( tempOnThis ) ;
123
123
for ( let i = 0 ; i < complexTemplates . length ; i ++ ) {
124
124
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
+ }
127
133
}
128
134
}
129
135
complexTemplates = Object . keys ( tempOnThis ) ;
@@ -184,7 +190,7 @@ export class ComponentBase<T> {
184
190
// Refer Link: https://github.com/angular/angular/issues/6005
185
191
setTimeout ( ( ) => {
186
192
/* 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' ) ) {
188
194
tempAfterViewThis . appendTo ( tempAfterViewThis . element ) ;
189
195
tempAfterViewThis . ngEle . nativeElement . style . visibility = '' ;
190
196
}
@@ -268,7 +274,7 @@ export class ComponentBase<T> {
268
274
tempAfterContentThis . setProperties ( propObj , tagObject . instance . isInitChanges ) ;
269
275
} else {
270
276
/* 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 ( ) ) ) ) {
272
278
tempAfterContentThis [ tagObject . name ] = tagObject . instance . list ;
273
279
}
274
280
for ( let list of tagObject . instance . list ) {
@@ -278,7 +284,7 @@ export class ComponentBase<T> {
278
284
complexTemplates = complexTemplates . filter ( ( val : string ) : boolean => {
279
285
return / R e f $ / i. test ( val ) ;
280
286
} ) ;
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 ) {
282
288
for ( let complexPropName of complexTemplates ) {
283
289
complexPropName = complexPropName . replace ( / R e f / , '' ) ;
284
290
curChild . properties [ complexPropName ] = ! curChild . properties [ complexPropName ] ?
0 commit comments