Victor Ivens
Victor Ivens

Reputation: 2279

Add custom page transition on ionic 2 rc0

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.

Upvotes: 1

Views: 1270

Answers (1)

Paul Samsotha
Paul Samsotha

Reputation: 208964

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);
  }
}

Upvotes: 3

Related Questions