# Directive is not showing HTML

**URL:** <https://forum.ionicframework.com/t/directive-is-not-showing-html/43356>\
**Category:** ionic-v3\
**Created:** [February 10, 2016, 11:34am UTC](https://forum.ionicframework.com/t/directive-is-not-showing-html/43356 "2016-02-10T11:34:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbakker1996](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mbakker1996/32/96698_2.png) [@mbakker1996](https://forum.ionicframework.com/u/mbakker1996)\
**Post date:** [February 10, 2016, 11:34am UTC](https://forum.ionicframework.com/t/directive-is-not-showing-html/43356/1 "2016-02-10T11:34:55Z")

</div>

Hello,

I’ve a WrittenHoursPage and I want to create a directive for a calendar I’m going to created. For now I want that in the comes `<p>test</p>` but it is not showing that.

Can someone see what I’m doing wrong?

```auto
import {Page} from 'ionic/ionic';
import {WrittenHoursCalendar} from './calendar-plugin/calendar.directive'

@Page({
    templateUrl: 'build/pages/written-hours/written-hours.html',
    directives: WrittenHoursCalendar
})

export class WrittenHoursPage {
    constructor() {

    }

}

import {Directive} from 'angular2/core';

@Directive({
    selector: 'calendar',
    templateUrl: './calendar.html'
})

class WrittenHoursCalendar {
    constructor(){

    }
}

```

---

<div class="post-metadata">

**Author:** ![keczan](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/keczan/32/97039_2.png) [@keczan](https://forum.ionicframework.com/u/keczan)\
**Post date:** [February 15, 2016, 4:32pm UTC](https://forum.ionicframework.com/t/directive-is-not-showing-html/43356/2 "2016-02-15T16:32:48Z")

</div>

We are having the same issue:

```auto
import {Directive} from 'angular2/core';

/*
  Generated class for the Timebar directive.

  See https://angular.io/docs/ts/latest/api/core/DirectiveMetadata-class.html
  for more info on Angular 2 Directives.
*/
@Directive({
  selector: 'timebar', //element selector <div timebar></timebar>
  templateUrl: 'build/components/timebar/timebar.html'
})
export class Timebar {
  constructor() {
    console.log('Hello World');

  }
}

```

---

<div class="post-metadata">

**Author:** ![brandyshea](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brandyshea/32/148286_2.png) [@brandyshea](https://forum.ionicframework.com/u/brandyshea)\
**Post date:** [February 16, 2016, 12:15am UTC](https://forum.ionicframework.com/t/directive-is-not-showing-html/43356/3 "2016-02-16T00:15:46Z")

</div>

Directives are not used with templates in Angular 2. You need to use a Component. A good SO on this:

> <https://stackoverflow.com/questions/32680244/directive-v-s-component-in-angular>

A more in depth post on this:

> **[The Core Concepts of Angular – Angular](https://vsavkin.com/the-core-concepts-of-angular-2-c3d6cbe04d04?gi=210de8692722)**
>
> Victor Savkin is a co-founder of nrwl.io, providing Angular consulting to enterprise teams. He was previously on the Angular core team at…

---

<div class="post-metadata">

**Author:** ![mrameezraja](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mrameezraja/32/12745_2.png) [@mrameezraja](https://forum.ionicframework.com/u/mrameezraja)\
**Post date:** [February 16, 2016, 1:34pm UTC](https://forum.ionicframework.com/t/directive-is-not-showing-html/43356/4 "2016-02-16T13:34:08Z")

</div>

What brandyshea says plus directives provider is an array

> [@mbakker1996](#):
>
> import {Page} from ‘ionic/ionic’;  
> import {WrittenHoursCalendar} from ‘./calendar-plugin/calendar.directive’
> 
> @Page({  
> templateUrl: ‘build/pages/written-hours/written-hours.html’,  
> **directives: [WrittenHoursCalendar] // not WrittenHoursCalendar**  
> })

---

<div class="post-metadata">

**Author:** ![keczan](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/keczan/32/97039_2.png) [@keczan](https://forum.ionicframework.com/u/keczan)\
**Post date:** [February 16, 2016, 4:26pm UTC](https://forum.ionicframework.com/t/directive-is-not-showing-html/43356/5 "2016-02-16T16:26:10Z")

</div>

This was definitely my issue. Thanks
