Hi everyone I am doing a custom directive... It apparently works correctly but an image is not shown... I let you see my directive
.directive('rhBanner', function () {
return {
restrict: 'E',
replace: true,
transclude: true,
templateUrl: '/partial_views/directives/templates/banner.html',
scope: {
rhTitle: '@title',
rhImgSrc: '@img'
},
controller: function () { }
};
})
Here the template:
<div class="tg-banner tg-haslayout parallax-window" data-appear-top-offset="600" data-parallax="scroll" data-image-src="{{ rhImgSrc }}">
<h1>{{ rhTitle }}</h1>
</div>
Here the HTML it produce (I think the HTML is correct):
<div class="tg-banner tg-haslayout parallax-window ng-isolate-scope" data-appear-top-offset="600" data-parallax="scroll" data-image-src="images/page-banner-img/img-01.jpg" title="Chi Siamo" img="images/page-banner-img/img-01.jpg">
<h1 class="ng-binding">Chi Siamo</h1>
</div>
If I copy and past that HTML directly in the page, everything works correctly, so the img-src path is correct! But perhaps I am wrong somewhere.. As you can see the title is replicated both in the H1 element and in the DIV element... is it strange, no?
Thank you