<my-directive ng-model="object"></my-directive>
.directive('myDirective', function(){
return {
template: '<div>{{object.elem1}}</div>'
}
})
return {
template: '<div>{{elem1}}</div>',
link: function(scope, el, attrs){
scope.elem1 = attrs.ngModel;
}
}
<my-directive obj="object"></my-directive>
return {
template: '<div>{{obj.elem1}}</div>',
scope: {
obj: '='
},
link: function(scope, el, attrs){
}
}