, template, . , , (MyCtrl) .
, , ,
http://plnkr.co/edit/jmWrNpLFttDPhSooPF0M?p=preview
.directive('myIsolatedScopedDirective', function(){
return {
scope : {
'title' : '@msdTitle'
},
replace: true,
template: '<div><h4>{{title}}</h4>' +
'<button ng-click="setDirectiveTitle(\'bob\')">Bob it!</button>',
link: function ($scope, $element, $attrs) {
$scope.setDirectiveTitle = function (title) {
$scope.title = title;
};
}
};
<div my-isolated-scoped-directive msd-title="I'm a directive within the app {{title}}"></div>