Angular: Empty Fiddle
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/angular-1.0.0rc5.js"></script>
<div ng-controller="MyParent">
<script type="text/ng-template" id="cdn/myChild.html">
<div>Luke, {{ message }} {{ relationship }}.</div>
</script>
<my-child relationship="your Dietitian"></my-child>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
myApp.directive('myChild', function() {
return {
restrict: 'E',
replace: true,
scope:{},
controller: function($scope, $element, $attrs){
//$scope.relationship = $attrs.relationship;
},
templateUrl: 'cdn/myChild.html'
}
});
function MyParent($scope) {
$scope.message = 'I am ';
$scope.relationship = 'your Father';
}