Ion-header-bar using Custom Directive

Hi All,

I am new on ionic but need to know 1 thing. It might be basic but I am not able to sort it out.

I have a directive which returns a templateurl. Given below.

angular.module(‘starter.controllers’, [])
.directive(‘contentHtml’, function () {
return {
restrict: ‘E’,
link: function (scope, element, attrs) {
// some ode
templateUrl: function (elem, attrs) {
return ‘templates/avatar.html’

And I am using this directive in following way.

<ion-side-menu side="left">
    <ion-header-bar class="bar-stable">

My directive is not being called. Am I doing something wrong? Or we are not allowed to do such thing?

Thank you in advance

Hi RafiqAhmed,

Why you making function and returning the url… you can directly give url to that TempletUrl…Have you tried that also???

I have just made the directive which returns me a view. The point is my directive is not called. Does my HTML is not recognizing my directive?