I have the following setup:
App/Directive
var app = angular.module(\"MyApp\", []);
app.directive(\"adminRosterItem\", function () {
return {
i think the right way to approach this would be to send the object into admin roster item, like this:
and in the directive:
var app = angular.module("MyApp", []);
app.directive("adminRosterItem", function () {
return {
restrict: "E",
scope: {
pos: "@"
},
template: "{{ formattedText }} ", // should I have this?
link: function(scope, element, attrs){
// all of this can easily be done with a filter, but i understand you just want to
// know how it works
scope.formattedText = scope.pos.Name + ' (' + scope.pos.Code + ')';
}
}
});
PS. i didn't test this!