Advertisement
Guest User

Untitled

a guest
May 1st, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. Code:
  2.  
  3.  
  4. var app = angular.module("myApp", []);
  5.  
  6. app.controller("module-menu-controller", function($scope, $compile) {
  7.  
  8. $scope.getGridObject = function() {
  9. alert("After render");
  10. };
  11. });
  12. app.directive("layoutRender", function() {
  13. return {
  14. restrict : "E",
  15. template : "<h1>Testing</h1>"
  16. };
  17. });
  18.  
  19. app.directive('afterGridRender', ['$timeout', function ($timeout) {
  20. var def = {
  21. restrict: 'A',
  22. terminal: true,
  23. transclude: false,
  24. link: function (scope, element, attrs) {
  25. $timeout(scope.$eval(attrs.getGridObject),0); //Calling a scoped method
  26. }
  27. };
  28. return def;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement