import { Component } from '@angular/core' ; import { NavController } from 'ionic-angular' ; import { TabsPage } from '../tabs/tabs' ; import { UserData } from '../../providers/user-data' ; @ Component ( { templateUrl : 'build/pages/signup/signup.html' } ) export class SignupPage { signup : { username ? : string ; password ? : string ; } = { } ; submitted = false ; constructor ( public navCtrl , public userData ) { } onSignup ( form ) { this . submitted = true ; if ( form . valid ) { this . userData . signup ( this . signup . username ) ; this . navCtrl . push ( TabsPage ) ; } } }