I have these directive
app.directive("myarticle",function($timeout){
return {
restrict: "E",
replace: true,
templateUrl: "templates/article.html",
link: function(scope, element, attrs) {
element.getVal()
}
,
scope: {
cat: "=",
mainurl: "="
}
}
});
here is the directive template
<div class="span2 ">
<a href="#/cat/{{cat.id}}"> link to cat</a>
</div>
the jquery getVal function
(function($) {
$.fn.getVal = function() {
this.each(function() {
var url =$(this).find("a").attr("href");
console.log(url);
});
};
})(jQuery);
the function is so long , I tried to simplify it as I can
what I expected to render is "#/cats/1" but what is rendered is "#cats/{{cat.id}}"
so how can I get the value of expression not the expression it self