hi,
I have the code like
@ViewChild(Content) content: Content;
...
this.content.addScrollListener((event) => {
...
installed 2.0.0-rc.3-201612122136
which in my mind is predecessor of rc4, and now it stopped working
how it should be written for upcoming rc4?
1 Like
Oh dude, You scared me. I thought this was the actual RC4 lol.
I believe it stays the same
no, in current build there is no addScrollListener for Content.
Just check documentation.
you also can check sources
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, NgZone, OnDestroy, Optional, Output, Renderer, ViewChild, ViewEncapsulation } from '@angular/core';
import { App } from '../app/app';
import { Config } from '../../config/config';
import { DomController } from '../../platform/dom-controller';
import { Img } from '../img/img-interface';
import { Ion } from '../ion';
import { isTabs } from '../../navigation/nav-util';
import { assert, isTrueProperty, removeArrayItem } from '../../util/util';
import { Keyboard } from '../../platform/keyboard';
import { NavController } from '../../navigation/nav-controller';
import { Content as IContent, Tabs } from '../../navigation/nav-interfaces';
import { Platform } from '../../platform/platform';
import { ScrollEvent, ScrollView } from '../../util/scroll-view';
import { ViewController } from '../../navigation/view-controller';
export { ScrollEvent } from '../../util/scroll-view';
export class EventEmitterProxy<T> extends EventEmitter<T> {
This file has been truncated. show original
sIb
December 16, 2016, 7:23am
6
+1 ( Property âaddScrollListenerâ does not exist on type âContentâ.)
In RC.4 you could do:
content.ionScroll.subscribe(($event: any) => {
}
where content is content: Content
6 Likes
seems like your solution works, but I still canât port my code to rc4, it hangs
1 Like
what hangs? do you have another issue open on the forum?
Got the same problem. It works with this solution.
Sorry for the late reply.
My app hanging, should debug this deeper, but decided to move forward with rc3, and update only after Ionic release, because every rc update takes 2-3 days of development just to fix stuff.
I should say for me, this time at least, the update from RC.3 to RC.4 took like max a half day, but of course, depends of the app
changing the code took 10 minutes, but app just hangs in random plase, so debug will take disabling all components and turning them one by one, too much for simple useless switch.
Better to wait until release.
I could understand that, good luck
@theromis hi , have you found a work around thisâŚaddScrollListener
in RC 4
Iâm not sure if this helps, but it worked fine in my app:
this.content.ionScroll.subscribe(($event) => {
this.scrollAmount = $event.scrollTop;
});
yes, subscribe
works perfect
1 Like
You are my HERO,
Working fine.
Thanks.