AngularJS Live Example

HTML

<script src="http://code.angularjs.org/angular-1.0.0rc5.min.js"></script>
<!doctype html>
<html ng-app="HelloApp">
<body>
<hello-world name="John"></hello-world>
</body>
</html>

JavaScript

angular.module('components', [])
    .directive('helloWorld', function () {
        return {
            restrict: 'E',
            scope:{
                name:'bind'
            },
            template: '<span>{{name}}</span>',
            controller: function($scope) {
                console.log($scope);
                console.log($scope.name);
            }
        }
    })

angular.module('HelloApp', ['components'])