Last active
August 29, 2015 13:56
-
-
Save pfallasro/9314337 to your computer and use it in GitHub Desktop.
AngularJS very simple directive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.directive("superman", function () { | |
| return { | |
| restrict:"A"; | |
| link: function () { | |
| alert("I'm working") | |
| } | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var myApp = angular.module('myApp', []); | |
| app.directive("superman", function () { | |
| return { | |
| restrict:"E"; | |
| template: "<div>Here I am to save the day</div>" | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment