angular.module('myModule', ['RecursionHelper']).directive("tree", function(RecursionHelper) {
return {
restrict: "E",
scope: {family: '=', level='@'},
template:
'<p>{{ family.name }}{{test }}</p>'+
'<ul>' +
'<li ng-repeat="child in family.children">' +
'<tree family="child" level="{{(level)?level + 1: 1}}"></tree>' +
'</li>' +
'</ul>',
compile: function(element) {
return RecursionHelper.compile(element, function(scope, iElement, iAttrs, controller, transcludeFn){
});
}
};
});
class User extends Eloquent {
public function task()
{
return $this->hasOne('Task');
}
}
class Task extends Eloquent {
public function user()
{
return $this->belongsTo('User');
}
}
Task::with('user')->where('user_id', '=', $id)->get()
angular.module('myDirective, [])
.directive('myDirective', function() {
return {
restrict: 'E',
scope: {
selectObject: '='
},
link: function(scope, element, attrs, controllers) {
scope.selectObject = 'Result value';
};
});
<my-directive select-object="myVariableInControlle"></my-directive>