# Directive working for ionic serve, but not for build

**URL:** <https://forum.ionicframework.com/t/directive-working-for-ionic-serve-but-not-for-build/72804>\
**Category:** ionic-v3\
**Created:** [December 9, 2016, 9:02pm UTC](https://forum.ionicframework.com/t/directive-working-for-ionic-serve-but-not-for-build/72804 "2016-12-09T21:02:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahstanin](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ahstanin](https://forum.ionicframework.com/u/ahstanin)\
**Post date:** [December 9, 2016, 9:02pm UTC](https://forum.ionicframework.com/t/directive-working-for-ionic-serve-but-not-for-build/72804/1 "2016-12-09T21:02:45Z")

</div>

Hey there, I was trying to build an ionic browser app. I am using all latest dependencies. I followed Angular 2 tutorial to setup directive :

app.component.ts

```
@Directive({selector: '[dataFile]'})

export class dataFileDirective {
    constructor(private el: ElementRef) {
    }

    @Input('dataFile') WordFile: any;
}

```

app.module.ts  
`import and declarations`

home.html  
`<div dataFile="{{word.pro}}"></div>`

When I am using `ionic serve` it’s working just perfect as it suppose to be. But when I try to `build` or `run` the Directive selector missing from my div `<div></div>`. While for `ionic serve` it used to be `<div ng-reflect--word-file="shunshine"></div>`.

Any idea what could be wrong here?

Thanks in advance

@max @mhartington
