Skip to content

Instantly share code, notes, and snippets.

@vienhoang
Created October 8, 2014 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vienhoang/c91a9b816436fc667ad1 to your computer and use it in GitHub Desktop.
Save vienhoang/c91a9b816436fc667ad1 to your computer and use it in GitHub Desktop.
Angular: Directive controller
// Custom directive controller
app.directive("productPanels", function(){
return {
restrict: 'E',
templateUrl: 'product-panel.html'
controller: function() {
// Controller logic
},
controllerAs: 'panels'
};
});
---
In index.html
<product-panels></product-panels>
---
Partial product-panel
<section>
...
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment