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 / finishRender.module.js
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/finishRender.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/finishRender.module.js
new file mode 100644 (file)
index 0000000..3faf3f1
--- /dev/null
@@ -0,0 +1,24 @@
+define(['angularAMD'], function(ng) {
+  var module = angular.module('app.common.finishRender', []);
+
+  module.config(function($compileProvider) {
+    module.register = {
+      directive : $compileProvider.register
+    };
+  });
+
+  module.directive('onFinishRender', function ($timeout) {
+      return {
+          restrict: 'A',
+          link: function (scope, element, attr) {
+              if (scope.$last === true) {
+                  $timeout(function () {
+                      scope.$emit('ngRepeatFinished');
+                  });
+              }
+          }
+      };
+  });
+
+  return module;
+});