angularjs - Utility functions for directives -
say want make angular directive generates links resources this: <a href="http://link/to/resource/1234">link/to/resource/1234</a> from object looks like: resource = { id: 1234, otherproperty: 'foo' } how can w/ directive? ie, i'd not have repeat part goes '/link/to/resource/{{id}}' . can't seem work right. 1 of several things i've tried: app.directive('myresource', function() { return { restrict: 'e', scope: { resource: '=' }, baseurl: 'link/to/{{resource.id}}', template: '<a href="http://{{baseurl}}">{{baseurl}}</a>' }; }); which ends rendering: <a href="http://" class="ng-binding"></a> other things i've tried (like making baseurl function/sticking in scope ) have resulted in similar things/errors. is there way work? one way handle use directive's link function set variab...