feat(ion-router): dynamic routes

This commit is contained in:
Manu Mtz.-Almeida
2018-03-15 16:53:38 +01:00
parent 147a6090e4
commit 7c3cba0b92
8 changed files with 133 additions and 61 deletions

View File

@ -49,6 +49,11 @@ string
string
## Events
#### ionRouteDataChanged
----------------------------------------------

View File

@ -1,12 +1,25 @@
import { Component, Prop } from '@stencil/core';
import { Component, Event, Prop } from '@stencil/core';
import { EventEmitter } from 'ionicons/dist/types/stencil.core';
@Component({
tag: 'ion-route'
})
export class Route {
@Prop() url = '';
@Prop() component: string;
@Prop() redirectTo: string;
@Prop() componentProps: {[key: string]: any};
@Event() ionRouteDataChanged: EventEmitter;
componentDidLoad() {
this.ionRouteDataChanged.emit();
}
componentDidUnload() {
this.ionRouteDataChanged.emit();
}
componentDidUpdate() {
this.ionRouteDataChanged.emit();
}
}