Add seed code for sdnr app based on ONF Centennial
[ccsdk/apps.git] / sdnr / wireless-transport / code-Carbon-SR1 / apps / dlux / dlux-web / src / common / general / common.general.filters.js
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.filters.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.filters.js
new file mode 100644 (file)
index 0000000..519525c
--- /dev/null
@@ -0,0 +1,15 @@
+define(['common/general/common.general.module'], function(general) {
+
+  // Filter to return only valid ports (like id != 0)
+  general.filter('noRootPorts', function () {
+    return function (input) {
+      if (!input) {
+        return;
+      }
+      return input.filter(function(port) {
+        return port.nodeconnector.id !== "0" ? port : null;
+      });
+    };
+  });
+
+});