Skip to content

Instantly share code, notes, and snippets.

@mchelen
Last active January 17, 2018 20:41
Show Gist options
  • Save mchelen/d8dc8fdd6d0988c2be3a32c17305505e to your computer and use it in GitHub Desktop.
Save mchelen/d8dc8fdd6d0988c2be3a32c17305505e to your computer and use it in GitHub Desktop.
<my-directive foo="bar"></my-directive>
<span>
test {{foo}} test
</span>
myApp.directive('myDirective', function() {
return {
restrict:'E',
replace: true,
scope: {
foo: "="
},
templateUrl: 'myDirective.html',
compile: function compile(element, attrs) {
return {
pre: function preLink(scope, iElement, iAttrs, controller) {
},
post: function postLink(scope, iElement, iAttrs, controller) {
}
};
},
controller: function($scope) {
console.log($scope.foo);
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment