1
votes

I'm trying to make a custom page transition (shrinking the navbar and moving the avatar to it's place), but i'm having trouble finding any material on how to do it.

I found in this issue https://github.com/driftyco/ionic/issues/8186 that now it's easy to add page transitions.

However, in the end of the reply with the example code, @NoNameProvided said to modify app.module.ts file to register the transition like this:

this.config.setTransition('fade-transition', FadeTransition);

I wanna know how to properly use this config.setTransition, since isn't clear what I have to import in order to use this.config.

Once I get the custom page transition working, a blog post can be made, so other people learn how to do it.

Thanks in advance.

1

1 Answers

3
votes

You can just inject the Config into the AppModule constructor

import { Config } from 'ionic-angular';

@NgModule({})
class AppModule {
  constructor(private config: Config) {
    this.config.setTransition('fade-transition', FadeTransition);
  }
}