'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,9 +3,10 @@
 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));
-		}
+		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));
+		// }
 	};
 }); 
Change my-sample directive (using template property)
