Directive

In this example below you will see how to do a Directive with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by rsids, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright rsids ©
  • HTML
  • CSS
  • JavaScript
    <div ng-app="demo">
  <kitten />
</div>

/*Downloaded from https://www.codeseek.co/rsids/directive-XboOvq */
    


/*Downloaded from https://www.codeseek.co/rsids/directive-XboOvq */
    angular.module('demo', []).directive('kitten', kitten);

function kitten() {
  return {
    restrict: 'E', // Only allow as an element
    scope: false, // Don't create an isolate scope
    template: '<img src="http://placekitten.com/g/200/300" />' // Setup template
  }
}

Comments