Skip to content

Instantly share code, notes, and snippets.

@mgonto
Last active December 15, 2015 07:49
Show Gist options
  • Save mgonto/5226350 to your computer and use it in GitHub Desktop.
Save mgonto/5226350 to your computer and use it in GitHub Desktop.
Header angular
module.directive('header', function () {
return {
restrict: 'A', //This menas that it will be used as an attribute and NOT as an element. I don't like creating custom HTML elements
replace: true,
scope: {user: '='}, // This is one of the cool things :). Will be explained in post.
templateUrl: "/js/directives/header.html",
controller: ['$scope', '$filter', function ($scope, $filter) {
// Your behaviour goes here :)
}]
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment