Skip to content

Instantly share code, notes, and snippets.

@benjaminW78
Created September 10, 2015 14:54
Show Gist options
  • Select an option

  • Save benjaminW78/c3307972cd6aca7a1154 to your computer and use it in GitHub Desktop.

Select an option

Save benjaminW78/c3307972cd6aca7a1154 to your computer and use it in GitHub Desktop.

Revisions

  1. benjaminW78 created this gist Sep 10, 2015.
    22 changes: 22 additions & 0 deletions example
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    .directive('myDirective', [function () {
    return {
    restrict : 'E',
    replace : true,
    controller: 'MyController',
    templateUrl : 'directives/myDirective.tpl.html',
    link : function (scope, elem, attrs, controller) {
    scope.message = 'Hello World!';
    controller.toto();
    }
    };
    }])

    .controller('MyController', [function ($scope, $element, $attrs, $log, $timeout) {


    $scope.toto = function(){
    console.log(lololool);
    }

    });
    }])