Hi Jayfred,

Try something like this:
.directive('myDirective', function() {
    return {
        restrict: "E",
        template: "<span>{{cat}}</span>",
        scope: {},
        link: function(scope, elem, attr) {
            var shirtCat = {
                1: "Men In Black",
                2: "Roses Are Red",
                3: "Blue By You"
            };
            attr.$observe('itemid', function(newId) {
                scope.cat = shirtCat[newId];
            });
        }
    }
});



You can change the template it you really must, but its a lot of work, that 
is unneeded in this case!

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to