mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(nav-push): NavPush api docs
This commit is contained in:
@@ -3,7 +3,36 @@ import {NavController} from './nav-controller';
|
||||
import {NavRegistry} from './nav-registry';
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* Directive for declaratively linking to a new view instead of using
|
||||
* [NavController.push()](../NavController/#push). Similar to ui-router's `ui-sref`.
|
||||
*
|
||||
* Basic usage:
|
||||
* ```html
|
||||
* <button [nav-push]="pushPage"></button>
|
||||
* ```
|
||||
* To specify parameters you can use array syntax or the `nav-params` property:
|
||||
* ```html
|
||||
* <button [nav-push]="pushPage" [nav-params]="params"></button>
|
||||
* ```
|
||||
* Where `pushPage` and `params` are specified in your component:
|
||||
* ```ts
|
||||
* import {LoginPage} from 'login';
|
||||
* @IonicView({
|
||||
* template: `<button [nav-push]="pushPage" [nav-params]="params"></button>`
|
||||
* })
|
||||
* class MyPage {
|
||||
* constructor(){
|
||||
* this.pushPage = LoginPage;
|
||||
* this.params = { id: 42 };
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* ### Alternate syntax
|
||||
* You can also use syntax similar to Angular2's router, passing an array to NavPush:
|
||||
* ```html
|
||||
* <button [nav-push]="[pushPage, params]"></button>
|
||||
* ```
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[nav-push]',
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Map of possible views that can be navigated to using an Ionic NavController
|
||||
*/
|
||||
export class NavRegistry {
|
||||
|
||||
Reference in New Issue
Block a user