@@ -125,7 +125,8 @@ export class ViewNode {
125
125
( < any > this . parentNativeView ) . _addChildFromBuilder ( this . viewName , this . nativeView ) ;
126
126
this . attachUIEvents ( ) ;
127
127
} else {
128
- throw new Error ( "Parent view can't have children! " + this . _parentView ) ;
128
+ console . log ( 'parentNativeView: ' + this . parentNativeView ) ;
129
+ throw new Error ( "Parent view can't have children! " + this . parentNativeView ) ;
129
130
}
130
131
}
131
132
@@ -159,6 +160,12 @@ export class ViewNode {
159
160
}
160
161
161
162
public setAttribute ( attributeName : string , value : any ) : void {
163
+ if ( ! this . nativeView ) {
164
+ console . log ( 'Native view not created. Delaying attribute set: ' + attributeName ) ;
165
+ this . attributes [ attributeName ] = value ;
166
+ return ;
167
+ }
168
+
162
169
console . log ( 'Setting attribute: ' + attributeName ) ;
163
170
164
171
let specialSetter = getSpecialPropertySetter ( attributeName ) ;
@@ -254,7 +261,7 @@ export class ViewNode {
254
261
return this . children . indexOf ( childNode ) ;
255
262
}
256
263
257
- setProperty ( name : string , value : any ) {
264
+ public setProperty ( name : string , value : any ) {
258
265
console . log ( 'ViewNode.setProperty ' + this . viewName + ' setProperty ' + name + ' ' + value ) ;
259
266
if ( this . nativeView ) {
260
267
this . setAttribute ( name , value ) ;
@@ -287,3 +294,17 @@ export class ViewNode {
287
294
}
288
295
289
296
}
297
+
298
+ export class DummyViewNode extends ViewNode {
299
+ constructor ( public parentNode : ViewNode ) {
300
+ super ( parentNode , null , { } ) ;
301
+ }
302
+ public attachToView ( atIndex : number = - 1 ) {
303
+ }
304
+ public insertChildAt ( index : number , childNode : ViewNode ) {
305
+ }
306
+ public removeChild ( childNode : ViewNode ) {
307
+ }
308
+ setProperty ( name : string , value : any ) {
309
+ }
310
+ }
0 commit comments