I am currently having a problem passing an array to a directive through an attribute of this directive. I can read it as a String, but I need it as an array, so this is what I came up with, but it does not work. Help someone? thks in advance
Javascript ::
app.directive('post', function($parse){ return { restrict: "E", scope:{ title: "@", author: "@", content: "@", cover: "@", date: "@" }, templateUrl: 'components/postComponent.html', link: function(scope, element, attrs){ scope.tags = $parse(attrs.tags) } } }
HTML ::
<post title="sample title" tags="['HTML5', 'AngularJS', 'Javascript']" ... >
arrays angularjs parsing attributes directive
HeberLZ Apr 30 '13 at 1:23 2013-04-30 01:23
source share