'use strict';

eventsApp.directive('mySample', function($compile) {
	return {
		restrict: 'E',
		template: "<input type='text' ng-model='sampleData' /> {{sampleData}}<br/>"
		// link: function(scope, element, attrs, controller) {
		// 	var markup = "<input type='text' ng-model='sampleData' /> {{sampleData}}<br/>";
		// 	angular.element(element).html($compile(markup)(scope));
		// }
	};
}); 
'use strict';

eventsApp.directive('mySample', function($compile) {
	return {
		restrict: 'E',
		link: function(scope, element, attrs, controller) {
			var markup = "<input type='text' ng-model='sampleData' /> {{sampleData}}<br/>";
			angular.element(element).html($compile(markup)(scope));
		}
	};
}); 
--- 
+++ 
@@ -3,10 +3,9 @@
 eventsApp.directive('mySample', function($compile) {
 	return {
 		restrict: 'E',
-		template: "<input type='text' ng-model='sampleData' /> {{sampleData}}<br/>"
-		// link: function(scope, element, attrs, controller) {
-		// 	var markup = "<input type='text' ng-model='sampleData' /> {{sampleData}}<br/>";
-		// 	angular.element(element).html($compile(markup)(scope));
-		// }
+		link: function(scope, element, attrs, controller) {
+			var markup = "<input type='text' ng-model='sampleData' /> {{sampleData}}<br/>";
+			angular.element(element).html($compile(markup)(scope));
+		}
 	};
 }); 
Change my-sample directive (using template property)
