Angular: Empty Fiddle
http://angularjs.org/
by ahchurch
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
<div post-it message="{{message}}"></div>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
myApp.directive('postIt', function() {
return {
restrict: 'AE',
replace: 'true',
scope:{
message: "@"
},
template:"<div>Received: {{message}}</div>"
};
});
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.message = 'Superhero';
}