Browse Source

Fix doNotSerialize

David Catuhe 5 năm trước cách đây
mục cha
commit
c8f620b906
1 tập tin đã thay đổi với 16 bổ sung1 xóa
  1. 16 1
      src/node.ts

+ 16 - 1
src/node.ts

@@ -100,10 +100,25 @@ export class Node implements IBehaviorAware<Node> {
      */
     public inspectableCustomProperties: IInspectable[];
 
+    private _doNotSerialize = false;
     /**
      * Gets or sets a boolean used to define if the node must be serialized
      */
-    public doNotSerialize = false;
+    public get doNotSerialize() {
+        if (this._doNotSerialize) {
+            return true;
+        }
+
+        if (this._parentNode) {
+            return this._parentNode.doNotSerialize;
+        }
+
+        return false;
+    }
+
+    public set doNotSerialize(value: boolean) {
+        this._doNotSerialize = value;
+    }
 
     /** @hidden */
     public _isDisposed = false;