# ionScroll, ion-content and directive

**URL:** <https://forum.ionicframework.com/t/ionscroll-ion-content-and-directive/79129>\
**Category:** ionic-v1\
**Created:** [February 10, 2017, 12:38pm UTC](https://forum.ionicframework.com/t/ionscroll-ion-content-and-directive/79129 "2017-02-10T12:38:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sidneycorreia](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sidneycorreia/32/106926_2.png) [@sidneycorreia](https://forum.ionicframework.com/u/sidneycorreia)\
**Post date:** [February 10, 2017, 12:38pm UTC](https://forum.ionicframework.com/t/ionscroll-ion-content-and-directive/79129/1 "2017-02-10T12:38:04Z")

</div>

I am trying to use the **scroll** event of ion-content inside of directive as in [https://www.joshmorony.com](https://www.joshmorony.com) /high-performance-parallax-animation-in-ionic-2/. But scroll event is not triggered.

What to look for? (How can I to use addScrollListener and directive together?)

---

<div class="post-metadata">

**Author:** ![sidneycorreia](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sidneycorreia/32/106926_2.png) [@sidneycorreia](https://forum.ionicframework.com/u/sidneycorreia)\
**Post date:** [February 15, 2017, 1:02am UTC](https://forum.ionicframework.com/t/ionscroll-ion-content-and-directive/79129/2 "2017-02-15T01:02:26Z")

</div>

@joshmorony, @mhartington help me, please.

---

<div class="post-metadata">

**Author:** ![evandillon](https://avatars.discourse-cdn.com/v4/letter/e/6bbea6/32.png) [@evandillon](https://forum.ionicframework.com/u/evandillon)\
**Post date:** [March 11, 2017, 2:33am UTC](https://forum.ionicframework.com/t/ionscroll-ion-content-and-directive/79129/3 "2017-03-11T02:33:07Z")

</div>

If you want to capture when ion-content is scrolling, try the following in your directive.

See: [https://github.com/driftyco/ionic/blob/master/src/components/content/content.ts](https://github.com/driftyco/ionic/blob/master/src/components/content/content.ts) for more info

```
import { Content } from 'ionic-angular';

```

then in your constructor

```
constructor(private content:Content) {

}

```

Then add

```
ngOnInit(){
    this.content.ionScroll.subscribe(data => {
        console.log('scrolling...');
    }
}
```

---

<div class="post-metadata">

**Author:** ![MichaleJie](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/michalejie/32/107904_2.png) [@MichaleJie](https://forum.ionicframework.com/u/MichaleJie)\
**Post date:** [March 27, 2017, 1:12am UTC](https://forum.ionicframework.com/t/ionscroll-ion-content-and-directive/79129/4 "2017-03-27T01:12:59Z")

</div>

I’m do it . nothings is happen,some one say this is reason ionic version,must be 2.1
