Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Code:
- var app = angular.module("myApp", []);
- app.controller("module-menu-controller", function($scope, $compile) {
- $scope.getGridObject = function() {
- alert("After render");
- };
- });
- app.directive("layoutRender", function() {
- return {
- restrict : "E",
- template : "<h1>Testing</h1>"
- };
- });
- app.directive('afterGridRender', ['$timeout', function ($timeout) {
- var def = {
- restrict: 'A',
- terminal: true,
- transclude: false,
- link: function (scope, element, attrs) {
- $timeout(scope.$eval(attrs.getGridObject),0); //Calling a scoped method
- }
- };
- return def;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement