mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-24 23:01:57 +08:00
@ -63,7 +63,44 @@ export class EventEmitterProxy<T> extends EventEmitter<T> {
|
||||
*
|
||||
* @advanced
|
||||
*
|
||||
* Resizing the content. If the height of `ion-header`, `ion-footer` or `ion-tabbar`
|
||||
* ### Sroll Events
|
||||
*
|
||||
* Scroll events happen outside of Angular's Zones. This is for performance reasons. So
|
||||
* if you're trying to bind a value to any scroll event, it will need to be wrapped in
|
||||
* a `zone.run()`
|
||||
*
|
||||
* ```ts
|
||||
* import { Component, NgZone } from '@angular/core';
|
||||
* @Component({
|
||||
* template: `
|
||||
* <ion-header>
|
||||
* <ion-navbar>
|
||||
* <ion-title>{{scrollAmount}}</ion-title>
|
||||
* </ion-navbar>
|
||||
* </ion-header>
|
||||
* <ion-content (ionScroll)="scrollHandler($event)">
|
||||
* <p> Some realllllllly long content </p>
|
||||
* </ion-content>
|
||||
* `})
|
||||
* class E2EPage {
|
||||
* public scrollAmount = 0;
|
||||
* constructor( public zone: NgZone){}
|
||||
* scrollHandler(event) {
|
||||
* console.log(`ScrollEvent: ${event}`)
|
||||
* this.zone.run(()=>{
|
||||
* // since scrollAmount is data-binded,
|
||||
* // the update needs to happen in zone
|
||||
* this.scrollAmount++
|
||||
* })
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* This goes for any scroll event, not just `ionScroll`.
|
||||
*
|
||||
* ### Resizing the content
|
||||
*
|
||||
* If the height of `ion-header`, `ion-footer` or `ion-tabbar`
|
||||
* changes dynamically, `content.resize()` has to be called in order to update the
|
||||
* layout of `Content`.
|
||||
*
|
||||
|
Reference in New Issue
Block a user