Catalin Dumitrache
Catalin Dumitrache

Reputation: 21

Angular html template inside a directive won't render

I know there are similar questions answered to this question, but none of the solutions worked for me. I have the following folder structure:

static
----calendar
--------calendar.controller.js
--------calendar.view.html
----home
--------home.controller.js
--------home.view.html
----app.js
----index.html

Inside calendar.controller.js I have created a directive for my calendar that looks like this:

.directive('myCalendar',function(){
        return{
            restrict:'E',
            template:"calendar.view.html"
        }
    })

I am trying to render that calendar template from home.view.html without success.

I have this in my home.view.html:

<my-calendar></my-calendar>

On the browser it actually displays the path I am trying to make him bind (on the browser you can see "./calendar/calendar.view.html"). And I've tried changing the directive's path in many ways:

 - template:"./calendar.view.html"
 - template:"/calendar.view.html"
 - template:"./calendar/calendar.view.html"
 - template:"/calendar/calendar.view.html"

... but it still won't work. Thank you.

Upvotes: 0

Views: 176

Answers (1)

Oleg Markoff
Oleg Markoff

Reputation: 321

 template:"calendar.view.html"

that is a mistake you need templateUrl:"calendar.view.html" instead

Upvotes: 1

Related Questions