Created
April 2, 2016 19:18
-
-
Save sidthesloth92/80e52b04d9c96419c8d0e5cde6bf8f06 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component} from 'angular2/core'; | |
import {Router} from 'angular2/router'; | |
@Component({ | |
selector : 'view-one', | |
template : `Route Parameter: <input type="text" [(ngModel)]="routeParameter"/> <br /> | |
Query Parameter: <input type="text" [(ngModel)]="queryParameter"/> <br /> | |
<button type="button" (click)="sendData()">Send</button>` | |
}) | |
export class ViewOneComponent { | |
public routeParameter : string; | |
public queryParameter : string; | |
constructor(private _router:Router) {} | |
public sendData() { | |
this._router.navigate(['ViewTwo', { routeParameter : this.routeParameter, queryParameter: this.queryParameter }]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment